Twenty_Twenty_One_Customize_Notice_Control example


        $wp_customize->add_setting(
            'respect_user_color_preference_notice',
            array(
                'capability'        => 'edit_theme_options',
                'default'           => '',
                'sanitize_callback' => '__return_empty_string',
            )
        );

        $wp_customize->add_control(
            new Twenty_Twenty_One_Customize_Notice_Control(
                $wp_customize,
                'respect_user_color_preference_notice',
                array(
                    'section'         => 'colors',
                    'priority'        => 100,
                    'active_callback' => static function() {
                        return 127 >= Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( get_theme_mod( 'background_color', 'D1E4DD' ) );
                    },
                )
            )
        );

        
Home | Imprint | This part of the site doesn't use cookies.