PHP Класс Habari\Pluggable

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$info
$plugin_id

Защищенные свойства (Protected)

Свойство Тип Описание
$_added_templates

Открытые методы

Метод Описание
__construct ( ) Pluggable constructor.
_configure_plugin_config ( array $actions, string $plugin_id ) : array Registered to the plugin_config hook to supply a config via a plugin's configure() method
_configure_plugin_ui ( string $plugin_id, string $action ) Registered to the plugin_ui hook to supply a config via a plugin's configure() method
_filter_rewrite_rules ( array $rules ) : array Add the rewrite rules queued by add_rule() to the full rule set
_help_plugin_config ( array $actions, string $plugin_id ) : array Registered to the plugin_config hook to supply help via a plugin's help() method
_help_plugin_ui ( string $plugin_id, string $action ) Registered to the plugin_ui hook to supply help via a plugin's help() method
_plugin_available_templates ( array $list ) : array Add plugin templates to the list of templates that are present in the current theme
_plugin_include_template_file ( string $file, string $name ) : string Potentially serve a different file for the requested template name
add_rule ( mixed $rule, string $hook, Callback $fn = null ) Add a rewrite rule that dispatches entirely to a plugin hook
get_db_schema ( ) : string Gets a database schema associated with this pluggable
get_file ( ) : string Gets the filename that contains this pluggable class
get_url ( boolean | string $trail = false ) : string Get a fully-qualified URL directory that contains this pluggable class
get_version ( ) : string Provide a method to return the version number from a pluggable's info
get_xml_text ( string $filename, SimpleXMLElement $node ) : mixed | string Get the text associated to an info xml node, possibly using an href parameter
load ( ) Called when a pluggable is loaded to register its actions and filters.
load_hooks ( mixed $object ) Registers all of this class' action_ and filter_ functions with the Plugins dispatcher Registers xmlrpc_ functions with the Plugins dispatcher, and turns '__' into '.' for the purposes of matching dotted XMLRPC requests.
load_text_domain ( string $domain ) : boolean Load a translation domain/file for this pluggable
plugin_id ( ) : string Returns a unique id for this pluggable
upgrade ( ) Execute the upgrade action on any pluggable that has a version number change Update the version number of the pluggable in the database to what is installed

Защищенные методы

Метод Описание
add_rest_rule ( string $hook, Pluggable $object, Callable $fn ) Adds a RewriteRule to the REST handler for the rule provided
add_template ( string $name, string $filename, boolean $override = false ) Adds a template to the default theme that is stored in a specified path.

Описание методов

__construct() публичный Метод

This function creates some internal structures that are required for plugin processing Plugins should not define their own constructors, because they are instantiated to extract plugin info. Instead, include a sink for a "init" hook which is executed immediately after the plugin is loaded during normal execution.
public __construct ( )

_configure_plugin_config() публичный Метод

Registered to the plugin_config hook to supply a config via a plugin's configure() method
public _configure_plugin_config ( array $actions, string $plugin_id ) : array
$actions array An array of actions applicable to this plugin
$plugin_id string The plugin id to which the actions belong
Результат array The modified array of actions

_configure_plugin_ui() публичный Метод

Registered to the plugin_ui hook to supply a config via a plugin's configure() method
public _configure_plugin_ui ( string $plugin_id, string $action )
$plugin_id string The id of the plugin whose action was triggered
$action string The action triggered

_filter_rewrite_rules() публичный Метод

Add the rewrite rules queued by add_rule() to the full rule set
public _filter_rewrite_rules ( array $rules ) : array
$rules array The array of current RewriteRules
Результат array The appended array of RewriteRules

_help_plugin_config() публичный Метод

Registered to the plugin_config hook to supply help via a plugin's help() method
public _help_plugin_config ( array $actions, string $plugin_id ) : array
$actions array An array of actions applicable to this plugin
$plugin_id string The plugin id to which the actions belong
Результат array The modified array of actions

_help_plugin_ui() публичный Метод

Registered to the plugin_ui hook to supply help via a plugin's help() method
public _help_plugin_ui ( string $plugin_id, string $action )
$plugin_id string The id of the plugin whose action was triggered
$action string The action triggered

_plugin_available_templates() публичный Метод

Add plugin templates to the list of templates that are present in the current theme
public _plugin_available_templates ( array $list ) : array
$list array List of template names in the current theme
Результат array The modified list of template names

_plugin_include_template_file() публичный Метод

Potentially serve a different file for the requested template name
public _plugin_include_template_file ( string $file, string $name ) : string
$file string The filename of the template the theme will display
$name string The name of the template requested
Результат string The potentially modified filename to use for the requested template.

add_rest_rule() защищенный статический Метод

Adds a RewriteRule to the REST handler for the rule provided
protected static add_rest_rule ( string $hook, Pluggable $object, Callable $fn )
$hook string The hook name to add a RewriteRule for
$object Pluggable The pluggable object holding the hook
$fn Callable The hook function to use to dispatch the request

add_rule() публичный Метод

Add a rewrite rule that dispatches entirely to a plugin hook
public add_rule ( mixed $rule, string $hook, Callback $fn = null )
$rule mixed An old-style rewrite rule string, where quoted segments are literals and unquoted segments are variable names, OR a RewriteRule object
$hook string The suffix of the hook function: action_plugin_act_{$suffix}
$fn Callback A potential function/method to register directly to the newly created hook

add_template() защищенный Метод

Use this function as a shortcut to make available additional templates to a theme from within the plugin directory.
protected add_template ( string $name, string $filename, boolean $override = false )
$name string The name of the template that will be displayed, sans extension
$filename string The full path of the template file used for the specified name
$override boolean If false, allow a template with the same name in the active theme directory to override this one. If true, always override the active theme's template with this one.

get_db_schema() закрытый публичный Метод

Gets a database schema associated with this pluggable
final public get_db_schema ( ) : string
Результат string The database schema

get_file() закрытый публичный Метод

Gets the filename that contains this pluggable class
final public get_file ( ) : string
Результат string The filename of the file that contains the pluggable class.

get_url() публичный Метод

Get a fully-qualified URL directory that contains this pluggable class
public get_url ( boolean | string $trail = false ) : string
$trail boolean | string If true, include a trailing slash. If string, append this to the requested url. Default: Add nothing.
Результат string URL

get_version() абстрактный публичный Метод

Provide a method to return the version number from a pluggable's info
abstract public get_version ( ) : string
Результат string The version of the pluggable

get_xml_text() публичный статический Метод

Get the text associated to an info xml node, possibly using an href parameter
public static get_xml_text ( string $filename, SimpleXMLElement $node ) : mixed | string
$filename string The filename of the xml file
$node SimpleXMLElement The text node with value children to sift through
Результат mixed | string The result text

load() публичный Метод

Called when a pluggable is loaded to register its actions and filters.
public load ( )

load_hooks() публичный статический Метод

If the class is an instance of Pluggable, registers the hooks with a plugin id also.
public static load_hooks ( mixed $object )
$object mixed The object or class name to register the hooks of

load_text_domain() публичный Метод

Load a translation domain/file for this pluggable
public load_text_domain ( string $domain ) : boolean
$domain string The name of the domain to load
Результат boolean true if data was successfully loaded, false otherwise

plugin_id() закрытый публичный Метод

Returns a unique id for this pluggable
final public plugin_id ( ) : string
Результат string A plugin id

upgrade() публичный Метод

Execute the upgrade action on any pluggable that has a version number change Update the version number of the pluggable in the database to what is installed
public upgrade ( )

Описание свойств

$_added_templates защищенное свойство

protected $_added_templates

$info публичное свойство

public $info

$plugin_id публичное свойство

public $plugin_id