Beispiel #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');
 }
Beispiel #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');
 }
Beispiel #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');
 }
Beispiel #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');
 }
Beispiel #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();
 }
Beispiel #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');
 }
Beispiel #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);
 }
Beispiel #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);
 }