/** * Constructs the class and sets all of the properties. */ public function __construct() { // Set the prefix. $this->setting_prefix = Config::getInstance()->getFrameworkConfig('setting_prefix'); // Set the validation class. $this->validator = ValidatesSettingOptions::getInstance(); }
/** * Constructs the class and sets all of it's properties. */ private function __construct() { // Set properties $this->config = Config::getInstance(); $this->modules_path = $this->config->getFrameworkConfig('modules_path'); $this->categories_path = $this->config->getFrameworkConfig('module_categories_path'); }
/** * Goes through a category and parses it's options to work with the wordpress customizer. */ private function parseThroughCategory($options) { // Will fill this with parsed objects. $parsed = array(); // Set object to setting. $parsed['object'] = 'setting'; // Set type to select. $parsed['type'] = 'select'; // Switch title to label. $parsed['label'] = $options['name']; // Module Options automatically get sanitized for text only. $parsed['sanitize_callback'] = 'esc_html'; // Add the prefix to the section $prefix = Config::getInstance()->getFrameworkConfig('setting_prefix'); $parsed['section'] = $prefix . $options['section']; // Add all allowed values. foreach ($options as $option => $value) { if (in_array($option, $this->allowed_category_customizer_keys)) { $parsed[$option] = $value; } } // Parse the content modules $parsed['choices'] = $this->parseModulesForCustomizer($options['modules']); // Return the parsed variables. return $parsed; }
/** * Builds up the class with all of the needed dependencies. */ private function __construct() { // Set the config object as a property. $this->config = Config::getInstance(); // Set the settings prefix from the framework config. $this->setting_prefix = $this->config->getFrameworkConfig('setting_prefix'); // Create an instance of the settings class. $this->settings = MakesSettingObjects::getInstance(); }
private function __construct() { // Instance of the Core Config class. $config = Config::getInstance(); // Setting prefix from the config file. $this->setting_prefix = $config->getFrameworkConfig('setting_prefix'); // Storage type from config file. $this->storage_type = array('customizer_settings' => $config->getFrameworkConfig('save_customizer_settings_as'), 'module_settings' => $config->getFrameworkConfig('save_module_settings_as')); }
/** * Bootstraps the Baseline Framework */ private function __construct($config_path) { $this->config_path = $config_path; // Initialize the Config right away and confirm the config path. $this->config = Config::getInstance($this->config_path); // Initialize the Settings Class right away for use in the theme setup. $this->settings = Settings::getInstance(); // Register everthing after the theme is setup add_action('init', array($this, 'initializeRegistration')); }
public function __construct($module_options) { // Get Modules Path from config. $modules_path = Config::getInstance()->getFrameworkConfig('module_templates_path'); // Create the file slug $file_slug = $modules_path . '/' . $module_options['template_path'] . '/' . $module_options['category']; // Set predefined variables for template. set_query_var('_baseline', BaselineFramework::getInstance()); set_query_var('_module', $module_options); // Do custom actions and call template part do_action('baseline_before_' . $category, $module_options); get_template_part($file_slug, $module_options['slug']); do_action('baseline_after_' . $category, $module_options); }
/** * Constructs the class and sets all properties. */ private function __construct() { // Main Config Instance $config = Config::getInstance(); // Core Registrar Class $this->registrar = Registrar::getInstance(); // Customizer Service Class $this->customizer = MakesCustomizerFields::getInstance(); // Customizer settings from the config file. $this->customizer_config = $config->getCustomizerConfig(); // Prefix that will be used for everything in the database. $this->setting_prefix = $config->getFrameworkConfig('setting_prefix'); // Storage type for different settings. $this->storage_type = array('customizer_settings' => $config->getFrameworkConfig('save_customizer_settings_as'), 'module_settings' => $config->getFrameworkConfig('save_module_settings_as')); }
/** * Constructs the class and sets its properties. */ public function __construct() { // Set the prefix. $this->setting_prefix = Config::getInstance()->getFrameworkConfig('setting_prefix'); }