PHP 클래스 Habari\Pluggable

파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$info
$plugin_id

보호된 프로퍼티들

프로퍼티 타입 설명
$_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