type = $args['type']; if ( isset( $args['callback'] )) $this->callback = $args['callback']; if ( isset( $args['wp_customize'] )) $this->wp_customize = $args['wp_customize']; } public function add_panel( $id, $args ) { if ( isset( $this->wp_customize )) { $args = wp_parse_args( $args, array( 'priority' => 30, 'capability' => 'edit_theme_options', 'theme_supports' => '' )); $this->wp_customize->add_panel( $id, $args ); } else { $this->panels[$id] = $args; $this->panels[$id]['href'] = '#' . $id; } } public function add_section( $id, $args ) { if ( isset( $this->wp_customize )) { $args = wp_parse_args( $args, array( 'priority' => 30 )); $this->wp_customize->add_section( $id, $args ); } else $this->sections[$id] = $args; } public function add_control( $id_base, $args = array() ) { if ( isset( $this->section )) $args['section'] = $this->section; if ( isset( $this->wp_customize )) { $this->wp_customize->add_control( new $id_base( $this->wp_customize, $args )); return; } $control = new $id_base( $this, $args ); if ( $this->type === 'widget' ) $control->widget(); else if ( $this->type === 'echo' ) $control->callback(); else if ( $this->type === 'tabs' ) $this->controls[$control->section][] = array( $control, 'callback' ); } public function add_sub_control( $id_base, $args ) { if ( $this->type === 'tabs' ) { $control = new $id_base( $this, $args ); $this->sub_controls[$control->control][$control->control_value][] = array( $control, 'callback' ); } else $this->add_control( $id_base, $args ); } public function add_setting( $id, $args ) { $this->settings[$id] = $args; } public function get_setting() {} public function buildTabs() { foreach( $this->panels as $id => $args ) echo '