Some get_theme_mod() calls return bool(false)
-
Hello and thanks for having me.
I am creating a custom theme- currently adding some settings and controls. The problem I have is that SOME settings return
bool(false)when called when I am NOT inside the Customizer. Other settings call just fine when I am working in/out of the Customizer. Seems like a scope or permissions issue? But then why would other settings call just fine.
Example of setting that works both inside/outside of Customizer:
// action bar color $wp_customize->add_setting( 'action-bar-color', array( 'default' => '#99b1ff', 'transport' => 'postMessage')); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'action-bar-color-control', array( 'label' => __( 'Action Bar Background Color', 'myTheme' ), 'section' => 'header-section', 'settings' => 'action-bar-color', 'priority' => 26 ) ) );Example of setting that DOES NOT work outside of the Customizer:
// woocommerce header menu 'log in button' title $wp_customize->add_setting( 'woo-menu-log-in-title', array( 'default' => 'Log In', 'transport' => 'refresh' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'woo-menu-log-in-control', array( 'label' => __( 'Log In Button Title', 'myTheme' ), 'section' => 'woocommerce-section', 'settings' => 'woo-menu-log-in-title', 'priority' => 14 ) ) );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Some get_theme_mod() calls return bool(false)’ is closed to new replies.