• Resolved Siteturner

    (@diablothemes)


    Maybe someone can shed some light on a recent issue I’m having –

    I keep getting:

    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.

    …even despite the fact that I do have sanitization callbacks specified for all settings. However, the problem seems to be that I’m passing an array to add_setting(). For example:

    $wp_customize->add_setting( $theme_slug_setting[‘id’], $theme_slug_setting[‘args’] );

    If I replace $theme_slug_setting[‘args’] with the array itself written out, Theme Check passes as expected. Is there some reason I have to explicitly write out the array for add_setting()?

    Thanks!

    https://ww.wp.xz.cn/plugins/theme-check/

Viewing 1 replies (of 1 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    Theme Check is a rather simple tool, and it just reads your code, it doesn’t actually run it. So yes, it needs the arguments to be specified as a literal array, not as an array defined elsewhere and contained inside a variable.

Viewing 1 replies (of 1 total)

The topic ‘sanitization callback problem’ is closed to new replies.