WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKWordPressPlugin Class Reference
Inheritance diagram for WPDKWordPressPlugin:
WPDKPlugin

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...
 

Detailed Description

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.

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

Author
=undo= info@.nosp@m.wpxt.nosp@m.re.me
Date
2013-02-06
Version
0.10.0

Definition at line 42 of file wpdk-wordpress-plugin.php.

Constructor & Destructor Documentation

__construct (   $file)

Construct.

Create a WPDKWordPressPlugin instance

Parameters
string$fileUsually you set it as __FILE__, which is the name of main file of plugin
Returns
WPDKWordPressPlugin

Definition at line 222 of file wpdk-wordpress-plugin.php.

Member Function Documentation

_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()

See Also
deactivation()

Definition at line 512 of file wpdk-wordpress-plugin.php.

admin ( )

Admin.

See _init()

See Also
theme()

Definition at line 500 of file wpdk-wordpress-plugin.php.

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.

Since
1.0.0.b4
Parameters
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.

Deprecated:
since 1.2.0 use preferences() instead

Definition at line 563 of file wpdk-wordpress-plugin.php.

static currentURL ( )
static

Return the current URL.

Return the current complete URL with protocol (http or https), server name, port and URI

Returns
string The current complete URL

Definition at line 322 of file wpdk-wordpress-plugin.php.

deactivation ( )

Deactivation.

Called when a plugin is deactivate; register_deactivation_hook()

See Also
activation()

Definition at line 524 of file wpdk-wordpress-plugin.php.

loaded ( )
Deprecated:
since 1.4.20

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 protocol ( )
static

Site protocol.

Return the current web site protocol. The protocol property is set too.

Returns
string 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', ... ) ) );
Parameters
string | array$sLoadingPathPath of class when $mClassName is a string
string$mClassNameOptional. 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 ( )

Theme.

See _init()``

Definition at line 535 of file wpdk-wordpress-plugin.php.

static urlAjax ( )
static

Ajax URL.

Returns the standard URL used by WordPress Ajax request.

Returns
string Standard URL for Ajax request

Definition at line 310 of file wpdk-wordpress-plugin.php.

widgets ( )

Widget init.

Called by action hook widget_init

Since
0.7.5

Definition at line 547 of file wpdk-wordpress-plugin.php.

Field Documentation

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

Log.

A WPDKWatchDog pointer

Definition at line 115 of file wpdk-wordpress-plugin.php.

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://

See Also
self::protocol() static method

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

Plugin URL.

The Plugin URL

Definition at line 162 of file wpdk-wordpress-plugin.php.

string $url_images

Images URL.

The Plugin URL more assets/css/images/

Deprecated:
Since 0.6.3 - Use imagesURL instead

Definition at line 199 of file wpdk-wordpress-plugin.php.

string $url_javascript

Javascript URL.

The Plugin URL more assets/js/

Deprecated:
Since 0.6.3 - Use javascriptURL instead

Definition at line 210 of file wpdk-wordpress-plugin.php.

string $urlAjax

Ajax URL.

The Default WordPress admin Ajax URL gateway

See Also
self::urlAjax() static method

Definition at line 172 of file wpdk-wordpress-plugin.php.


The documentation for this class was generated from the following file: