get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $arenabiz_categories = get_categories(array('hide_empty' => 0)); foreach ($arenabiz_categories as $arenabiz_category) { $arenabiz_cat[$arenabiz_category->term_id] = $arenabiz_category->cat_name; } $arenabiz_pages = get_pages(array('hide_empty' => 0)); foreach ($arenabiz_pages as $arenabiz_pages_single) { $arenabiz_page_choice[$arenabiz_pages_single->ID] = $arenabiz_pages_single->post_title; } /*============GENERAL SETTINGS PANEL============*/ $wp_customize->add_panel( 'arenabiz_general_settings_panel', array( 'title' => esc_html__( 'General Settings', 'arenabiz' ), 'priority' => 10 ) ); //STATIC FRONT PAGE $wp_customize->add_section( 'static_front_page', array( 'title' => esc_html__( 'Static Front Page', 'arenabiz' ), 'panel' => 'arenabiz_general_settings_panel', 'description' => esc_html__( 'Your theme supports a static front page.', 'arenabiz'), ) ); //TITLE AND TAGLINE SETTINGS $wp_customize->add_section( 'title_tagline', array( 'title' => esc_html__( 'Site Logo/Title/Tagline', 'arenabiz' ), 'panel' => 'arenabiz_general_settings_panel', ) ); //BACKGROUND IMAGE $wp_customize->add_section( 'background_image', array( 'title' => esc_html__( 'Background Image', 'arenabiz' ), 'panel' => 'arenabiz_general_settings_panel', ) ); //COLOR SETTINGS $wp_customize->add_section( 'colors', array( 'title' => esc_html__( 'Colors' , 'arenabiz'), 'panel' => 'arenabiz_general_settings_panel', ) ); //Footer SETTINGS $wp_customize->add_section( 'footer', array( 'title' => esc_html__( 'Footer Settings' , 'arenabiz'), 'panel' => 'arenabiz_general_settings_panel', ) ); $wp_customize->add_setting( 'arenabiz_footer_title', array( 'sanitize_callback' => 'arenabiz_sanitize_text', 'default' => '' ) ); $wp_customize->add_control( 'arenabiz_footer_title', array( 'settings' => 'arenabiz_footer_title', 'section' => 'footer', 'type' => 'text', 'label' => esc_html__( 'Footer copyright text', 'arenabiz' ) ) ); //Blog SETTINGS $wp_customize->add_section( 'blog', array( 'title' => esc_html__( 'Blog Settings' , 'arenabiz'), 'panel' => 'arenabiz_general_settings_panel', ) ); $wp_customize->add_setting( 'arenabiz_blog_title', array( 'sanitize_callback' => 'arenabiz_sanitize_text', 'default' => '' ) ); $wp_customize->add_control( 'arenabiz_blog_title', array( 'settings' => 'arenabiz_blog_title', 'section' => 'blog', 'type' => 'text', 'label' => esc_html__( 'Blog title', 'arenabiz' ) ) ); } add_action( 'customize_register', 'arenabiz_customize_register' ); /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function arenabiz_customize_preview_js() { wp_enqueue_script( 'arenabiz-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'arenabiz_customize_preview_js' ); function arenabiz_customizer_script() { wp_enqueue_script( 'arenabiz-customizer-script', get_template_directory_uri() .'/admin/js/customizer-scripts.js', array("jquery"),'', true ); wp_enqueue_style( 'arenabiz-customizer-style', get_template_directory_uri() .'/inc/css/customizer-style.css'); } add_action( 'customize_controls_enqueue_scripts', 'arenabiz_customizer_script' ); if( class_exists( 'WP_Customize_Control' ) ): class arenabiz_Dropdown_Chooser extends WP_Customize_Control{ public $type = 'dropdown_chooser'; public function render_content(){ if ( empty( $this->choices ) ) return; ?> choices ) ) return; ?> label ); ?> description ) ) : ?> description); ?> value() ) ? explode( ',', $this->value() ) : $this->value(); ?> link(); ?> value="" /> label ) ) : ?>

label ); ?>

description){ ?> description); ?> placeholder = $args['placeholder']; parent::__construct( $manager, $id, $args ); } public function render_content(){ if ( empty( $this->choices ) ) return; $saved_value = $this->value(); if(!is_array($saved_value)){ $saved_value = array(); } ?> cats = get_categories($options); parent::__construct( $manager, $id, $args ); } public function render_content(){ if(!empty($this->cats)){ ?> on_off_label = $args['on_off_label']; parent::__construct( $manager, $id, $args ); } public function render_content(){ ?> label ); ?> description){ ?> description); ?> value() == 'on') ? 'switch-on' : ''; $on_off_label = $this->on_off_label; ?>
link(); ?> type="hidden" value="value()); ?>"/> label ); ?> description){ ?> description); ?> get_control( $setting->id ); if ( array_key_exists( $input, $control->choices ) ) { return $input; } else { return $setting->default; } } function arenabiz_sanitize_choices_array( $input, $setting ) { global $wp_customize; if(!empty($input)){ $input = array_map('absint', $input); } return $input; }