/** * Initializes the plugin framework. * * This function adds all components to the plugin. It is executed on the 'after_setup_theme' hook with priority 3. * The action 'wpcd' should be used to add all the components. * * @internal * @see WPCD\App::add_components() * @see WPCD\App::add() * @since 0.5.0 */ public function init() { if (!did_action('wpcd')) { ComponentManager::register_hierarchy(apply_filters('wpcd_class_hierarchy', array('WPCD\\Components\\Panel' => array('WPCD\\Components\\Section' => array('WPCD\\Components\\Field' => array()))))); do_action('wpcd', $this); } else { self::doing_it_wrong(__METHOD__, __('This function should never be called manually.', 'customizer-definitely'), '0.5.0'); } }
/** * Initializes the plugin framework. * * This function adds all components to the plugin. It is executed on the 'after_setup_theme' hook with priority 1. * The action 'wpod' should be used to add all the components. * * @internal * @see WPOD\App::add_components() * @see WPOD\App::add() * @since 0.5.0 */ public function init() { if (!did_action('wpod')) { /** * This filter can be used to alter the component hierarchy of the plugin. * It must only be used to add more components to the hierarchy, never to change or remove something existing. * * @since 0.5.0 * @param array the nested array of component class names */ ComponentManager::register_hierarchy(apply_filters('wpod_class_hierarchy', array('WPDLib\\Components\\Menu' => array('WPOD\\Components\\Screen' => array('WPOD\\Components\\Tab' => array('WPOD\\Components\\Section' => array('WPOD\\Components\\Field' => array()))))))); /** * The main API action of the plugin. * * Every developer must hook into this action to register components. * * @since 0.5.0 * @param WPOD\App instance of the main plugin class */ do_action('wpod', $this); } else { self::doing_it_wrong(__METHOD__, __('This function should never be called manually.', 'options-definitely'), '0.5.0'); } }
/** * Initializes the plugin framework. * * This function adds all components to the plugin. It is executed on the 'after_setup_theme' hook with priority 5. * The action 'wpptd' should be used to add all the components. * * @internal * @see WPPTD\App::add_components() * @see WPPTD\App::add() * @since 0.5.0 */ public function init() { if (!did_action('wpptd')) { $hierarchy = array('WPDLib\\Components\\Menu' => array('WPPTD\\Components\\PostType' => array('WPPTD\\Components\\Metabox' => array('WPPTD\\Components\\Field' => array()), 'WPPTD\\Components\\Taxonomy' => array()))); if (wpptd_supports_termmeta()) { $hierarchy['WPDLib\\Components\\Menu']['WPPTD\\Components\\PostType']['WPPTD\\Components\\Taxonomy'] = array('WPPTD\\Components\\TermMetabox' => array('WPPTD\\Components\\TermField' => array())); } /** * This filter can be used to alter the component hierarchy of the plugin. * It must only be used to add more components to the hierarchy, never to change or remove something existing. * * @since 0.5.0 * @param array the nested array of component class names */ ComponentManager::register_hierarchy(apply_filters('wpptd_class_hierarchy', $hierarchy)); /** * The main API action of the plugin. * * Every developer must hook into this action to register components. * * @since 0.5.0 * @param WPPTD\App instance of the main plugin class */ do_action('wpptd', $this); $this->taxonomies_temp = array(); } else { self::doing_it_wrong(__METHOD__, __('This function should never be called manually.', 'post-types-definitely'), '0.5.0'); } }