Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     $this->objectRegistry = Baobab::objectRegistry();
     $this->loadPsr4();
     Hooks::action('after_setup_theme', $this, 'instantiateClasses');
 }
Ejemplo n.º 2
0
 /**
  * Apply the data to configure the theme
  */
 public function run()
 {
     parent::run();
     // Register image sizes
     $this->addImageSizes();
     // Add sizes to the media attachment settings dropdown list.
     Hooks::action('image_size_names_choose', $this, 'addSizesToDropDownList');
 }
Ejemplo n.º 3
0
 /**
  * Constructor
  *
  * @param string $id The ID of the initializer
  * @param array $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     // Boostrap Kirki
     Hooks::filter('kirki/config', $this, 'configureKirki');
     Hooks::filter('customize_register', $this, 'createPanels');
     Hooks::filter('kirki/controls', $this, 'registerControls');
     /** @noinspection PhpIncludeInspection */
     require_once Paths::vendors('aristath/kirki/kirki.php');
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     // If blade is enabled, include required files
     if ($this->isBladeEnabled()) {
         require_once Paths::vendors('autoload.php');
     }
     // Our themes should be properly structured, so we could also provide some common templates within a
     // different folder
     Hooks::filter('get_search_form', $this, 'suggestMoreSearchFormTemplates');
 }
Ejemplo n.º 5
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     // Define the theme text domain constant as early as possible
     if (!isset($data['text_domain'])) {
         throw new InvalidConfigurationException('\\Baobab\\Configuration\\Initializer\\ThemeSettings', 'text_domain');
     }
     define('BAOBAB_TEXTDOMAIN', $data['text_domain']);
     // Some restrictions
     $this->restrictAdminBarVisibility();
     $this->restrictAdminPanelAccess();
     // Ajax
     $this->setupAjax();
 }
Ejemplo n.º 6
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     require_once Paths::vendors('tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php');
     Hooks::action('tgmpa_register', $this, 'configureTgmPluginActivationLibrary');
 }
Ejemplo n.º 7
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
     Hooks::action('wp_enqueue_scripts', $this, 'registerAssets', 99);
     Hooks::action('wp_enqueue_scripts', $this, 'enqueueAssets', 100);
 }
Ejemplo n.º 8
0
 /**
  * Constructor
  *
  * @param string $id   The ID of the initializer
  * @param array  $data The configuration key/value pairs
  */
 public function __construct($id, $data)
 {
     parent::__construct($id, $data);
 }