Title: sanitization callback problem
Last modified: August 22, 2016

---

# sanitization callback problem

 *  Resolved [Siteturner](https://wordpress.org/support/users/diablothemes/)
 * (@diablothemes)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/sanitization-callback-problem/)
 * 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://wordpress.org/plugins/theme-check/](https://wordpress.org/plugins/theme-check/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 3 months ago](https://wordpress.org/support/topic/sanitization-callback-problem/#post-5765797)
 * 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.

 * ![](https://ps.w.org/theme-check/assets/icon-128x128.png?rev=972579)
 * [Theme Check](https://wordpress.org/plugins/theme-check/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-check/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-check/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-check/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-check/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-check/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/sanitization-callback-problem/#post-5765797)
 * Status: resolved