function initComponent()
 {
     $component = PBData::get('component');
     foreach ($component as $componentName => $componentData) {
         $path = PLUGIN_PAGE_BUILDER_COMPONENT_PATH . $componentName . '/class/PB.Component.' . $this->formatName($componentName) . '.class.php';
         if (is_file($path)) {
             PBInclude::includeFileFromDir(PLUGIN_PAGE_BUILDER_COMPONENT_PATH . $componentName . '/class/');
             $className = 'PBComponent' . $this->formatName($componentName);
             $Component = new $className();
             if (method_exists($Component, 'initCustomPostType')) {
                 $Component->initCustomPostType();
             }
             $this->componentData[$componentName] = $Component->init();
             if (method_exists($Component, 'initPublic')) {
                 $Component->initPublic();
             }
             $this->addShortcode($componentName, $Component, $this->componentData[$componentName]);
             $style = $Component->addStyle();
             if (is_array($style)) {
                 $this->library['style'] += $style;
             }
             $script = $Component->addScript();
             if (is_array($script)) {
                 $this->library['script'] += $script;
             }
         }
     }
 }
Пример #2
0
<?php

/******************************************************************************/
/******************************************************************************/
require_once plugin_dir_path(__FILE__) . 'define.php';
/******************************************************************************/
require_once PLUGIN_PAGE_BUILDER_CLASS_PATH . 'PB.File.class.php';
require_once PLUGIN_PAGE_BUILDER_CLASS_PATH . 'PB.Include.class.php';
require_once PLUGIN_PAGE_BUILDER_CLASS_PATH . 'PB.PageBuilder.class.php';
PBInclude::includeFileFromDir(PLUGIN_PAGE_BUILDER_CLASS_PATH);
/******************************************************************************/
/******************************************************************************/