Theme customizer sanitization
-
There is a problem with a required setting with the wordpress theme check plugin, this is the error that i get:
REQUIRED: Found a Customizer setting that did not have a sanitization callback function. Every call to the add_setting() method needs to have a sanitization callback function passed.
Im not able to find anything related to sanitize a logo upload, the only things i can find is to sanitize integers and other settings but not image uploads,
this is what i have in functions.php
function themeslug_theme_customizer( $wp_customize ) { // create a new section for our logo upload $wp_customize->add_section( 'themeslug_logo_section' , array( 'title' => __( 'Logo', 'themeslug' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header', ) ); // register our new setting $wp_customize->add_setting( 'themeslug_logo' ); // tell the Theme Customizer to let us use an image uploader for setting our logo $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array( 'label' => __( 'Logo', 'themeslug' ), 'section' => 'themeslug_logo_section', 'settings' => 'themeslug_logo',) ) ); } add_action('customize_register', 'themeslug_theme_customizer');
- The topic ‘Theme customizer sanitization’ is closed to new replies.