Strata\Controller\Loader\ShortcodeLoader

Automated the declaration of Wordpress Shortcodes within a Strata Controller object.

    Synopsis

    class ShortcodeLoader {
    }

    Members

    private

    • $controllerStrata\Controller\Loader\Controller;
      The Strata Controller instance towards which the shortcodes callbacks will route.
    • $shortcodes — array
      A list of normalized shortcodes and shortcode configuration.

    Methods

    private

    • formatCode() — Per Wordpress' configuration, shortcodes must be formatted roughly as underscored function names.
    • getNormalizedShortcodes() — Returns a normalized list of controller shortcodes.

    public

    • __construct() — Shortcode loader constructor builds a list of shortcode configurations associated to a controller and instantiates them as dynamic callbacks.
    • hasShortcodes() — Specifies if a number of shortcodes have been defined.
    • register() — Registers dynamic shortcode hooks to the instantiated controller.
    • unregister() — Unregisters the list of shortcodes in Wordpress.