array(), ); /* * Display for options and meta */ public function display() { $this->echoOptionHeader(); ?>echoOptionFooter(); } /* * Display for theme customizer */ public function registerCustomizerControl( $wp_customize, $section, $priority = 1 ) { $isAssociativeArray = false; if ( count( $this->settings['options'] ) ) { foreach ( $this->settings['options'] as $value => $label ) { $isAssociativeArray = is_array( $label ); break; } } // Not associative array, do normal control if ( ! $isAssociativeArray ) { $class = "TitanFrameworkCustomizeControl"; // Associative array, custom make the control } else { $class = "TitanFrameworkOptionSelectControl"; } $wp_customize->add_control( new $class( $wp_customize, $this->getID(), array( 'label' => $this->settings['name'], 'section' => $section->settings['id'], 'type' => 'select', 'choices' => $this->settings['options'], 'settings' => $this->getID(), 'description' => $this->settings['desc'], 'priority' => $priority, ) ) ); } } /* * We create a new control for the theme customizer (for the grouped options only) */ add_action( 'customize_register', 'registerTitanFrameworkOptionSelectControl', 1 ); function registerTitanFrameworkOptionSelectControl() { class TitanFrameworkOptionSelectControl extends WP_Customize_Control { public $description; public function render_content() { ?> {$this->description}

"; } } }