WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
__construct ($file) | |
Construct. More... | |
registerAutoloadClass ($sLoadingPath, $mClassName= '') | |
Records a WPX plugin class into autoloading register. More... | |
autoloadEnvironment ($sClassName) | |
Runtime autoloading of plugin classes. More... | |
reloadTextDomain () | |
Force text domain reload. More... | |
_init () | |
WordPress action when the plugin is loaded. More... | |
admin_init () | |
Admin init. More... | |
preferences () | |
Init Preferences. More... | |
ajax () | |
Ajax request. More... | |
admin () | |
Admin. More... | |
activation () | |
Activation. More... | |
deactivation () | |
Deactivation. More... | |
theme () | |
Theme. More... | |
widgets () | |
Widget init. More... | |
configuration () | |
Action for init configuration. More... | |
loaded () | |
Public Member Functions inherited from WPDKPlugin | |
__construct ($file=null) | |
Construct. More... | |
active () | |
deactive () | |
uninstall () | |
readMetadata ($aWPXHeaders) | |
Static Public Member Functions | |
static | protocol () |
Site protocol. More... | |
static | urlAjax () |
Ajax URL. More... | |
static | currentURL () |
Return the current URL. More... | |
Data Fields | |
$assetsURL | |
Assets URL. More... | |
$classesPath | |
Classes path. More... | |
$cssURL | |
Style sheet URL. More... | |
$databasePath | |
Database path. More... | |
$folderName | |
Plugin folder. More... | |
$imagesURL | |
Images URL. More... | |
$javascriptURL | |
Javascript URL. More... | |
$log | |
Log. More... | |
$path | |
Filesystem plugin path. More... | |
$pluginBasename | |
Plugin folder and main file. More... | |
$protocol | |
Protocol. More... | |
$slug | |
Plugin slug. More... | |
$url | |
Plugin URL. More... | |
$urlAjax | |
Ajax URL. More... | |
$url_images | |
Images URL. More... | |
$url_javascript | |
Javascript URL. More... | |
Data Fields inherited from WPDKPlugin | |
$active = false | |
Active. More... | |
$author = '' | |
Author. More... | |
$authorName = '' | |
Author. More... | |
$authorURI = '' | |
Author URI. More... | |
$description = '' | |
Description. More... | |
$file = '' | |
Path file. More... | |
$icon = '' | |
Icon. More... | |
$id = '' | |
ID. More... | |
$name = '' | |
Plugin name. More... | |
$network = '' | |
Network. More... | |
$pluginURI = '' | |
Plugin URI. More... | |
$textDomain = '' | |
Plugin Text Domain. More... | |
$textDomainPath = '' | |
Text domain Plugin url. More... | |
$title = '' | |
Title. More... | |
$version = '' | |
Version. More... | |
The WPDKWordPressPlugin class is the most important class of all in WordPress Development Kit (WPDK) because performs all init procedures for a Plugin that wants to be compatible with the wpXtreme standard.
The WPDKWordPressPlugin class provides the fundamental startup of plugin. You rarely (never) instantiate WPDKWordPressPlugin object directly. Instead, you instantiate subclasses of the WPDKWordPressPlugin class.
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.
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.
WPDKWatchDog
object for own logThe path propertis are the filesystem unix path. The URL properties are the HTTP protocol URI.
See below for detail
See below for detail
Definition at line 42 of file wpdk-wordpress-plugin.php.
__construct | ( | $file | ) |
Construct.
Create a WPDKWordPressPlugin instance
string | $file | Usually you set it as __FILE__ , which is the name of main file of plugin |
Definition at line 222 of file wpdk-wordpress-plugin.php.
_init | ( | ) |
WordPress action when the plugin is loaded.
Called by action hook 'init'
Definition at line 437 of file wpdk-wordpress-plugin.php.
activation | ( | ) |
Activation.
Called when a plugin is activate; register_activation_hook()
Definition at line 512 of file wpdk-wordpress-plugin.php.
admin | ( | ) |
admin_init | ( | ) |
Admin init.
Called by action hook 'admin_init'
Definition at line 468 of file wpdk-wordpress-plugin.php.
ajax | ( | ) |
Ajax request.
This method is to override and it is called when an Ajax request is performed.
Definition at line 488 of file wpdk-wordpress-plugin.php.
autoloadEnvironment | ( | $sClassName | ) |
Runtime autoloading of plugin classes.
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.
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.
string | $sClassName | - The class that has to be loaded right now |
Definition at line 408 of file wpdk-wordpress-plugin.php.
configuration | ( | ) |
Action for init configuration.
Called after loaded()
method. Use this for init your own configuration.
Definition at line 563 of file wpdk-wordpress-plugin.php.
|
static |
Return the current URL.
Return the current complete URL with protocol (http
or https
), server name, port and URI
Definition at line 322 of file wpdk-wordpress-plugin.php.
deactivation | ( | ) |
Deactivation.
Called when a plugin is deactivate; register_deactivation_hook()
Definition at line 524 of file wpdk-wordpress-plugin.php.
loaded | ( | ) |
Definition at line 571 of file wpdk-wordpress-plugin.php.
preferences | ( | ) |
Init Preferences.
Called after load_plugin_textDomain()
in _init
Definition at line 478 of file wpdk-wordpress-plugin.php.
|
static |
Site protocol.
Return the current web site protocol. The protocol
property is set too.
http
or https
Definition at line 298 of file wpdk-wordpress-plugin.php.
registerAutoloadClass | ( | $sLoadingPath, | |
$mClassName = '' |
|||
) |
Records a WPX plugin class into autoloading register.
This function records a WPX plugin class into autoloading register, joined with its loading path. 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', ... ) ) );
string | array | $sLoadingPath | Path of class when $mClassName is a string |
string | $mClassName | Optional. The single class name or key value pairs array with path => classes |
Definition at line 366 of file wpdk-wordpress-plugin.php.
reloadTextDomain | ( | ) |
Force text domain reload.
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.
Definition at line 423 of file wpdk-wordpress-plugin.php.
theme | ( | ) |
|
static |
Ajax URL.
Returns the standard URL used by WordPress Ajax request.
Definition at line 310 of file wpdk-wordpress-plugin.php.
widgets | ( | ) |
Widget init.
Called by action hook widget_init
Definition at line 547 of file wpdk-wordpress-plugin.php.
string $assetsURL |
Assets URL.
The Plugin URL more assets/
. This property is very useful for read style sheet and Javascript file in the 'assets' folder.
Definition at line 52 of file wpdk-wordpress-plugin.php.
string $classesPath |
Classes path.
The Filesystem plugin path more classes/
Definition at line 61 of file wpdk-wordpress-plugin.php.
string $cssURL |
Style sheet URL.
The Plugin URL more assets/css/
Definition at line 70 of file wpdk-wordpress-plugin.php.
string $databasePath |
Database path.
The Filesystem plugin path more database/
Definition at line 79 of file wpdk-wordpress-plugin.php.
string $folderName |
Plugin folder.
The plugin folder, Eg. wpx-smartshop/
Definition at line 88 of file wpdk-wordpress-plugin.php.
string $imagesURL |
Images URL.
The Plugin URL more assets/css/images/
Definition at line 97 of file wpdk-wordpress-plugin.php.
string $javascriptURL |
Javascript URL.
The Plugin URL more assets/js/
Definition at line 106 of file wpdk-wordpress-plugin.php.
WPDKWatchDog $log |
string $path |
Filesystem plugin path.
Filesystem plugin path
Definition at line 124 of file wpdk-wordpress-plugin.php.
string $pluginBasename |
Plugin folder and main file.
The Plugin folder and main file, Eg. wpx-smartshop/main.php
This is used as unique code id.
Definition at line 134 of file wpdk-wordpress-plugin.php.
string $protocol |
Protocol.
The Protocol http://
or https://
Definition at line 144 of file wpdk-wordpress-plugin.php.
string $slug |
Plugin slug.
The plugin slug build with WordPress sanitize_title()
Definition at line 153 of file wpdk-wordpress-plugin.php.
string $url |
string $url_images |
Images URL.
The Plugin URL more assets/css/images/
imagesURL
insteadDefinition at line 199 of file wpdk-wordpress-plugin.php.
string $url_javascript |
Javascript URL.
The Plugin URL more assets/js/
javascriptURL
insteadDefinition at line 210 of file wpdk-wordpress-plugin.php.
string $urlAjax |
Ajax URL.
The Default WordPress admin Ajax URL gateway
Definition at line 172 of file wpdk-wordpress-plugin.php.