function shandora_option_pages($option_pages) { require_once BON_THEME_DIR . '/includes/theme-options.php'; $shandora_pages = array('slug' => 'bon_options', 'parent' => 'bon_options', 'title' => __('Theme Settings', 'bon'), 'role' => 'manage_options', 'option_key' => 'bon_optionsframework', 'customizer' => true, 'option_set' => bon_set_theme_options()); array_unshift($option_pages, $shandora_pages); return $option_pages; }
public function setup_customize_option() { if (function_exists('bon_set_theme_options')) { $theme_opts = bon_set_theme_options(); } foreach ($this->option_pages as $option_pages) { if (!isset($option_pages['customizer'])) { continue; } $settings = get_option($option_pages['option_key']); $option_name = $settings['id']; $options = $option_pages['option_set']; foreach ($options as $k => $v) { if (isset($v['theme_customizer']) && !empty($v['theme_customizer']) && is_array($v['theme_customizer']) && isset($v['theme_customizer']['customizer_section'])) { $name = $option_name . '_' . $v['theme_customizer']['customizer_section']; if (isset($v['theme_customizer']['customizer_section_theme']) && $v['theme_customizer']['customizer_section_theme'] == false) { $name = $v['theme_customizer']['customizer_section']; } if (!array_key_exists($name, $this->customizer)) { $this->customizer[$name] = array('title' => isset($v['theme_customizer']['customizer_section_title']) ? $v['theme_customizer']['customizer_section_title'] : 'Section Title', 'priority' => isset($v['theme_customizer']['customizer_section_priority']) ? $v['theme_customizer']['customizer_section_priority'] : 100); $this->customizer[$name]['settings'][$option_name . '_' . $v['id']] = array('label' => $v['label'], 'setting_name' => $option_name . '[' . $v['id'] . ']', 'type' => $v['type'], 'options' => isset($v['options']) ? $v['options'] : array(), 'default' => isset($v['std']) ? $v['std'] : '', 'setting_type' => isset($v['theme_customizer']['customizer_type']) ? $v['theme_customizer']['customizer_type'] : 'option'); } else { $this->customizer[$name]['settings'][$option_name . '_' . $v['id']] = array('label' => $v['label'], 'settings' => $option_name . '[' . $v['id'] . ']', 'type' => $v['type'], 'default' => isset($v['std']) ? $v['std'] : '', 'options' => isset($v['options']) ? $v['options'] : array(), 'setting_type' => isset($v['theme_customizer']['customizer_type']) ? $v['theme_customizer']['customizer_type'] : 'option'); } } } } }