PHP 클래스 WPDKWordPressPlugin

## Overview The WPDKWordPressPlugin class provides the fundamental startup of plugin. You rarely (never) instantiate WPDKWordPressPlugin object directly. Instead, you instantiate subclasses of the WPDKWordPressPlugin class. ### Subclassing This class **must** be used to extend the main class of your plugin. Its function is to initialize the environment will operate on the plugin itself and record the Plugin for updates from WPX Store. ### Benefits In addition to initializing and recording, WPDKWordPressPlugin class performs for us a whole series of standard procedures in the writing of Plugin, in addition to providing a lot of properties and methods really comfortable. * Gets directly from standard WordPress comments prior information as to the description of the Plugin: plugin name, version, the text and the text domain domain path * Prepare a set of standard properties with paths and urls most commonly used * Provides a lot of hook to wrap (filters and actions) of most used WordPress * Prepare an instance of WPDKWatchDog object for own log ### Useful properties The path propertis are the filesystem unix path. The URL properties are the HTTP protocol URI. See below for detail ### Useful methods See below for detail
저자: =undo= ([email protected])
상속: extends WPDKPlugin
파일 보기 프로젝트 열기: wpxtreme/wpdk 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$assetsURL string The Plugin URL more assets/. This property is very useful for read style sheet and Javascript file in the 'assets' folder.
$classesPath string The Filesystem plugin path more classes/
$cssURL string The Plugin URL more assets/css/
$databasePath string The Filesystem plugin path more database/
$folderName string The plugin folder, Eg. wpx-smartshop/
$imagesURL string The Plugin URL more assets/css/images/
$javascriptURL string The Plugin URL more assets/js/
$path string Filesystem plugin path
$pluginBasename string The Plugin folder and main file, Eg. wpx-smartshop/main.php This is used as unique code id.
$protocol string The Protocol http:// or https://
$slug string The plugin slug build with WordPress sanitize_title()
$url string The Plugin URL
$urlAjax string The Default WordPress admin Ajax URL gateway
$url_images string The Plugin URL more assets/css/images/
$url_javascript string The Plugin URL more assets/js/

공개 메소드들

메소드 설명
__construct ( string $file = null ) : WPDKWordPressPlugin Create a WPDKWordPressPlugin instance
activation ( ) Called when a plugin is activate; register_activation_hook()
admin ( ) See _init()
admin_init ( ) Called by action hook 'admin_init'
ajax ( ) This method is to override and it is called when an Ajax request is performed.
autoloadEnvironment ( string $sClassName ) This function performs runtime autoloading of a class specifically related to this instance; this autoloading is based on previous class registering that has to be executed before.
currentURL ( ) : string Return the current complete URL with protocol (http or https), server name, port and URI
deactivation ( ) Called when a plugin is deactivate; register_deactivation_hook()
preferences ( ) Called after load_plugin_textdomain() in _init
protocol ( ) : string Return the current web site protocol. The protocol property is set too.
registerAutoloadClass ( string | array $sLoadingPath, string $mClassName = '' ) This function records a WPX plugin class into autoloading register, joined with its loading path.
reloadTextDomain ( ) Reload the text domain for multilingual. This method is useful when the loading procedure for the text domain (which occurs in plugins_loaded()) is not complete for some reason.
theme ( ) See _init()``
urlAjax ( ) : string Returns the standard URL used by WordPress Ajax request.
widgets ( ) Fires after all default WordPress widgets have been registered.

메소드 상세

__construct() 공개 메소드

Create a WPDKWordPressPlugin instance
public __construct ( string $file = null ) : WPDKWordPressPlugin
$file string Usually you set it as `__FILE__`, which is the name of main file of plugin
리턴 WPDKWordPressPlugin

activation() 공개 메소드

Called when a plugin is activate; register_activation_hook()
public activation ( )

admin() 공개 메소드

See _init()
public admin ( )

admin_init() 공개 메소드

Called by action hook 'admin_init'
public admin_init ( )

ajax() 공개 메소드

This method is to override and it is called when an Ajax request is performed.
public ajax ( )

autoloadEnvironment() 공개 메소드

NOTE: this SPL autoloading logic is encapsulated in every single plugin instance that extends this class, because it is embedded into an instance of WPDKWordPressPlugin. So any plugin has its own SPL autoloading logic.
부터: 1.0.0.b4
public autoloadEnvironment ( string $sClassName )
$sClassName string - The class that has to be loaded right now

currentURL() 공개 정적인 메소드

Return the current complete URL with protocol (http or https), server name, port and URI
public static currentURL ( ) : string
리턴 string The current complete URL

deactivation() 공개 메소드

Called when a plugin is deactivate; register_deactivation_hook()
public deactivation ( )

preferences() 공개 메소드

Called after load_plugin_textdomain() in _init
public preferences ( )

protocol() 공개 정적인 메소드

Return the current web site protocol. The protocol property is set too.
public static protocol ( ) : string
리턴 string `http` or `https`

registerAutoloadClass() 공개 메소드

The function has some facility in its first param, in order to allow both string and array loading of class names ( useful in case of a group of classes that are defined in a single file ). 1. $this->registerAutoloadClass( 'file.php', 'ClassName' ); 2. $this->registerAutoloadClass( array( 'file.php' => 'ClassName' ) ); 3. $this->registerAutoloadClass( array( 'file.php' => array( 'ClassName', 'ClassName', ... ) ) );
public registerAutoloadClass ( string | array $sLoadingPath, string $mClassName = '' )
$sLoadingPath string | array Path of class when $mClassName is a string
$mClassName string Optional. The single class name or key value pairs array with path => classes

reloadTextDomain() 공개 메소드

Reload the text domain for multilingual. This method is useful when the loading procedure for the text domain (which occurs in plugins_loaded()) is not complete for some reason.
public reloadTextDomain ( )

theme() 공개 메소드

See _init()``
public theme ( )

urlAjax() 공개 정적인 메소드

Returns the standard URL used by WordPress Ajax request.
public static urlAjax ( ) : string
리턴 string Standard URL for Ajax request

widgets() 공개 메소드

Fires after all default WordPress widgets have been registered.
부터: 0.7.5
public widgets ( )

프로퍼티 상세

$assetsURL 공개적으로 프로퍼티

The Plugin URL more assets/. This property is very useful for read style sheet and Javascript file in the 'assets' folder.
public string $assetsURL
리턴 string

$classesPath 공개적으로 프로퍼티

The Filesystem plugin path more classes/
public string $classesPath
리턴 string

$cssURL 공개적으로 프로퍼티

The Plugin URL more assets/css/
public string $cssURL
리턴 string

$databasePath 공개적으로 프로퍼티

The Filesystem plugin path more database/
public string $databasePath
리턴 string

$folderName 공개적으로 프로퍼티

The plugin folder, Eg. wpx-smartshop/
public string $folderName
리턴 string

$imagesURL 공개적으로 프로퍼티

The Plugin URL more assets/css/images/
public string $imagesURL
리턴 string

$javascriptURL 공개적으로 프로퍼티

The Plugin URL more assets/js/
public string $javascriptURL
리턴 string

$path 공개적으로 프로퍼티

Filesystem plugin path
public string $path
리턴 string

$pluginBasename 공개적으로 프로퍼티

The Plugin folder and main file, Eg. wpx-smartshop/main.php This is used as unique code id.
public string $pluginBasename
리턴 string

$protocol 공개적으로 프로퍼티

The Protocol http:// or https://
public string $protocol
리턴 string

$slug 공개적으로 프로퍼티

The plugin slug build with WordPress sanitize_title()
public string $slug
리턴 string

$url 공개적으로 프로퍼티

The Plugin URL
public string $url
리턴 string

$urlAjax 공개적으로 프로퍼티

The Default WordPress admin Ajax URL gateway
또한 보기: self::urlAjax() static method
public string $urlAjax
리턴 string

$url_images 공개적으로 프로퍼티

The Plugin URL more assets/css/images/
사용 중단: Since 0.6.3 - Use `imagesURL` instead
public string $url_images
리턴 string

$url_javascript 공개적으로 프로퍼티

The Plugin URL more assets/js/
사용 중단: Since 0.6.3 - Use `javascriptURL` instead
public string $url_javascript
리턴 string