3ev Core Wordpress library API
  • Namespace
  • Class

Namespaces

  • Tev
    • Application
      • Bootstrap
    • Author
      • Model
    • Contracts
    • Database
      • CustomTables
    • Field
      • Model
      • Util
    • Plugin
      • Action
      • Shortcode
    • Post
      • Model
      • Repository
    • Taxonomy
      • Model
      • Repository
    • Term
      • Model
      • Repository
    • Util
    • View
      • Exception
  • None

Classes

  • Loader

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 to register_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 to register_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 this

  • Action 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 classes

  • Shortcodes 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 to add_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 name

  • Custom 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__);
Namespace: Tev\Plugin
Located at Tev/Plugin/Loader.php

Methods summary

public
# __construct( Tev\Application\Application $app )

Constructor.

Constructor.

Inject dependencies.

Parameters

$app
Application
public Tev\Plugin\Loader
# load( string $basePath )

Load all plugin configuration.

Load all plugin configuration.

Parameters

$basePath
Plugin path

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadCustomTables( )

Load custom database table installers from configuration files.

Load custom database table installers from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadPostTypes( )

Load custom post types from configuration files.

Load custom post types from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadFieldGroups( )

Load custom field groups from configuration files.

Load custom field groups from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadActions( )

Load actions from configuration providers.

Load actions from configuration providers.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadAcfJson( )

Load ACF JSON config if supplied.

Load ACF JSON config if supplied.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadShortCodes( )

Load shortcodes from configuration files.

Load shortcodes from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadOptionScreens( )

Load custom option screens from configuration files.

Load custom option screens from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected Tev\Plugin\Loader
# loadCliCommands( )

Load custom WP CLI commands from configuration files.

Load custom WP CLI commands from configuration files.

Returns

Tev\Plugin\Loader
This, for chaining
protected string
# getConfigPath( )

Get the path to the config directory.

Get the path to the config directory.

Returns

string
protected string
# getSrcPath( )

Get the path to the config directory.

Get the path to the config directory.

Returns

string
protected string
# getViewsPath( )

Get the path to the config directory.

Get the path to the config directory.

Returns

string
protected string
# getPluginFile( )

Get the full path and filename of the plugin's registration file.

Get the full path and filename of the plugin's registration file.

Returns

string
protected array|null
# loadConfigFile( string $file )

Load a config file from the config directory.

Load a config file from the config directory.

Parameters

$file
Filename

Returns

array|null
Array config or null if not found

Properties summary

protected Tev\Application\Application $app

Application.

Application.

#
protected string $basePath

Plugin base path.

Plugin base path.

#
protected Tev\View\Renderer $renderer

View renderer.

View renderer.

#
3ev Core Wordpress library API API documentation generated by ApiGen