get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->add_section( 'arcegator_theme_options', array( 'title' => esc_html__( 'Theme Options', 'arcegator' ), 'priority' => 130, ) ); $wp_customize->add_setting( 'arcegator_sticky_header', array( 'default' => '', 'sanitize_callback' => 'arcegator_sanitize_checkbox', ) ); $wp_customize->add_control( 'arcegator_sticky_header', array( 'label' => esc_html__( 'Fixed header when scrolling down.', 'arcegator' ), 'section' => 'arcegator_theme_options', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'arcegator_footer_logo', array( 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'arcegator_footer_logo', array( 'label' => __( 'Upload Footer Logo', 'arcegator' ), 'section' => 'arcegator_theme_options', 'settings' => 'arcegator_footer_logo', ) ) ); $wp_customize->add_setting( 'arcegator_footer_top_column', array( 'default' => 'column-1', 'sanitize_callback' => 'arcegator_sanitize_column', ) ); $wp_customize->add_control( 'arcegator_footer_top_column', array( 'label' => esc_html__( 'Footer Area Layout', 'arcegator' ), 'section' => 'arcegator_theme_options', 'type' => 'radio', 'choices' => array( 'column-1' => esc_html__( '1 Column', 'arcegator' ), 'column-2' => esc_html__( '2 Columns', 'arcegator' ), 'column-3' => esc_html__( '3 Columns', 'arcegator' ), 'column-4' => esc_html__( '4 Columns', 'arcegator' ), ), ) ); $wp_customize->add_setting( 'arcegator_footer_bottom_column', array( 'default' => 'column-1', 'sanitize_callback' => 'arcegator_sanitize_column', ) ); $wp_customize->add_control( 'arcegator_footer_bottom_column', array( 'label' => esc_html__( 'Footer Area Layout', 'arcegator' ), 'section' => 'arcegator_theme_options', 'type' => 'radio', 'choices' => array( 'column-1' => esc_html__( '1 Column', 'arcegator' ), 'column-2' => esc_html__( '2 Columns', 'arcegator' ), 'column-3' => esc_html__( '3 Columns', 'arcegator' ), 'column-4' => esc_html__( '4 Columns', 'arcegator' ), ), ) ); } add_action( 'customize_register', 'arcegator_customize_register' ); /** * Sanitize the checkbox. * * @param boolean $input. * @return boolean true if portfolio page template displays title and content. */ function arcegator_sanitize_checkbox( $input ) { if ( 1 == $input ) { return true; } else { return false; } } /** * Sanitize the Column value. * * @param string $column. * @return string (column-1|column-2|column-3|column-4). */ function arcegator_sanitize_column( $column ) { if ( ! in_array( $column, array( 'column-1', 'column-2', 'column-3', 'column-4' ) ) ) { $column = 'column-1'; } return $column; } /** * Return whether we're on a view that supports a one or two column layout. */ function arcegator_theme_is_view_with_layout_option() { // This option is available on all pages. It's also available on archives when there isn't a sidebar. return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) ); }