function zels_framework_init() { // active modules defined('ZELS_ACTIVE_FRAMEWORK') or define('ZELS_ACTIVE_FRAMEWORK', true); defined('ZELS_ACTIVE_METABOX') or define('ZELS_ACTIVE_METABOX', true); defined('ZELS_ACTIVE_SHORTCODE') or define('ZELS_ACTIVE_SHORTCODE', true); defined('ZELS_ACTIVE_CUSTOMIZE') or define('ZELS_ACTIVE_CUSTOMIZE', true); // product info defined('ZELS_THEME_NAME') or define('ZELS_THEME_NAME', 'Zels'); defined('ZELS_THEME_VERSION') or define('ZELS_THEME_VERSION', '1.0.0'); defined('ZELS_THEME_LOGO') or define('ZELS_THEME_LOGO', false); // helpers zels_locate_template('functions/deprecated.php'); zels_locate_template('functions/helpers.php'); zels_locate_template('functions/actions.php'); zels_locate_template('functions/enqueue.php'); zels_locate_template('functions/sanitize.php'); zels_locate_template('functions/validate.php'); // classes zels_locate_template('classes/abstract.class.php'); zels_locate_template('classes/options.class.php'); zels_locate_template('classes/framework.class.php'); zels_locate_template('classes/metabox.class.php'); zels_locate_template('classes/shortcode.class.php'); zels_locate_template('classes/customize.class.php'); // configs zels_locate_template('config/framework.config.php'); zels_locate_template('config/metabox.config.php'); // zels_locate_template ( 'config/shortcode.config.php' ); zels_locate_template('config/customize.config.php'); }
public function customize_register($wp_customize) { // load extra WP_Customize_Control zels_locate_template('functions/customize.php'); do_action('zels_customize_register'); $panel_priority = 0; foreach ($this->options as $value) { $this->priority = $panel_priority; if (isset($value['sections'])) { $wp_customize->add_panel($value['name'], array('title' => $value['title'], 'priority' => isset($value['priority']) ? $value['priority'] : $panel_priority, 'description' => isset($value['description']) ? $value['description'] : '')); $this->add_section($wp_customize, $value, $value['name']); } else { $this->add_section($wp_customize, $value); } $panel_priority++; } }
function zels_load_option_fields() { $located_fields = array(); foreach (glob(ZELS_DIR . '/fields/*/*.php') as $zels_field) { $located_fields[] = basename($zels_field); zels_locate_template(str_replace(ZELS_DIR, '', $zels_field)); } $override_name = apply_filters('zels_framework_override', 'zels-framework-override'); $override_dir = get_template_directory() . '/' . $override_name . '/fields'; if (is_dir($override_dir)) { foreach (glob($override_dir . '/*/*.php') as $override_field) { if (!in_array(basename($override_field), $located_fields)) { zels_locate_template(str_replace(ZELS_DIR . '-override', '', $override_field)); } } } do_action('zels_load_option_fields'); }