public function customize_register($wp_customize) { // load extra WP_Customize_Control sk_locate_template('functions/customize.php'); do_action('sk_customize_register'); $panel_priority = 1; 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 sk_load_option_fields() { global $skelet_path; $located_fields = array(); foreach (glob($skelet_path["dir"] . 'skelet/fields/*/*.php') as $sk_field) { $located_fields[] = basename($sk_field); sk_locate_template(str_replace($skelet_path["dir"] . 'skelet/', '', $sk_field), $skelet_path); } $override_name = apply_filters('sk_framework_override', 'sk-framework-override'); $override_dir = get_template_directory() . '/skelet/' . $override_name . '/fields'; if (is_dir($override_dir)) { foreach (glob($override_dir . '/*/*.php') as $override_field) { if (!in_array(basename($override_field), $located_fields)) { sk_locate_template(str_replace($skelet_path["dir"] . '-override', '', $override_field)); } } } do_action('sk_load_option_fields'); }
public static function instance() { global $skelet_paths, $skelet_path; // active modules defined('SK_ACTIVE_FRAMEWORK') or define('SK_ACTIVE_FRAMEWORK', true); defined('SK_ACTIVE_METABOX') or define('SK_ACTIVE_METABOX', true); defined('SK_ACTIVE_SHORTCODE') or define('SK_ACTIVE_SHORTCODE', true); defined('SK_ACTIVE_CUSTOMIZE') or define('SK_ACTIVE_CUSTOMIZE', true); defined('SK_ACTIVE_WIDGET') or define('SK_ACTIVE_WIDGET', true); defined('SK_ACTIVE_TAXONOMY') or define('SK_ACTIVE_TAXONOMY', true); defined('SK_ACTIVE_TEMPLATE') or define('SK_ACTIVE_TEMPLATE', true); foreach ($skelet_paths as $path) { // ------------------------------------------------------------------------------------------------ include_once wp_normalize_path(dirname(__FILE__) . '/path.php'); // ------------------------------------------------------------------------------------------------ $arr_last = $path; $path["basename"] = "skelet"; $path["option"] = $path["prefix"] . "_options"; $path["customize"] = $path["prefix"] . "_customize"; $skelet_path = $path; // helpers sk_locate_template('functions/deprecated.php', $skelet_path); sk_locate_template('functions/helpers.php', $skelet_path); sk_locate_template('functions/actions.php', $skelet_path); sk_locate_template('functions/enqueue.php', $skelet_path); sk_locate_template('functions/sanitize.php', $skelet_path); sk_locate_template('functions/validate.php', $skelet_path); sk_locate_template('functions/customize.php', $skelet_path); // classes sk_locate_template('classes/abstract.class.php', $skelet_path); sk_locate_template('classes/options.class.php', $skelet_path); sk_locate_template('classes/framework.class.php', $skelet_path); sk_locate_template('classes/metabox.class.php', $skelet_path); sk_locate_template('classes/shortcode.class.php', $skelet_path); sk_locate_template('classes/customize.class.php', $skelet_path); sk_locate_template('classes/taxonomy.class.php', $skelet_path); sk_locate_template('classes/template.class.php', $skelet_path); // configs if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/framework.config.php'))) { sk_locate_template('../../admin/options/framework.config.php', $skelet_path); } if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/metabox.config.php'))) { sk_locate_template('../../admin/options/metabox.config.php', $skelet_path); } if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/shortcode.config.php'))) { sk_locate_template('../../admin/options/shortcode.config.php', $skelet_path); } if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/customize.config.php'))) { sk_locate_template('../../admin/options/customize.config.php', $skelet_path); } if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/taxonomy.config.php'))) { sk_locate_template('../../admin/options/taxonomy.config.php', $skelet_path); } if (file_exists(wp_normalize_path($skelet_path["dir"] . '/options/template.config.php'))) { sk_locate_template('../../admin/options/template.config.php', $skelet_path); } if ($arr_last === end($skelet_paths)) { do_action("skelet_loaded"); } } }