Class Loader
Simple plugin loading utility.
Provides framework for loading plugin content by convention, as follows:
Custom post types are loaded from an array, defined in
config/post_types.php
in the plugin's directory. The array is a set of key value pairs, where the key is the post type identifier and the value is the config to pass toregister_post_type
Custom field groups are loaded from an array, in
config/field_groups.php
in the plugin's directory. The array is a set of arrays, defining each field group config to pass toregister_field_group
ACF JSON config is loaded from a directory, at
config/acf-json/
in the plugin's directory. See http://www.advancedcustomfields.com/resources/local-json/ for more information on thisAction callbacks are loaded from an array, in
config/actions.php
in the plugin's directory. The array is a set of key-value pairs, of action names to closure or action provider classesShortcodes are loaded from an array, in
config/shortcodes.php
in the plugin's directory. The array is a set of key value pairs, where the key is the shortcode name and the value is the config to pass toadd_shortcode
Custom WP CLI commands are loaded from an array, defined in
config/commands.php
in the plugin's directory. The array is a set of key value pairs, where the key is the command indentifier and the value is the fully-qualified class nameCustom database table installers are loaded from an array, defined in
config/tables.php
in the plugin's directory. The array is a set of fully-qualified installer class names
Usage:
// Add the following to your plugin's config file tev_fetch('plugin_loader')->load(__DIR__);
Methods summary
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
|
protected
array|null
|
Properties summary
protected
|
$app
Application. |
|
protected
string
|
$basePath
Plugin base path. |
|
protected
|
$renderer
View renderer. |