Support » Alpha/Beta/RC » sanitize_callback and add_settings_error() problem

  • I am trying out using the Settings API in conjunction with the new add_settings_error function..

    I have an issue, I want to use the same sanitize_callback function for verifing the input of two settings..
    However, it seems that the only variables I can access from within the sanitize_callback function is the $input value…

    From searching about it seems that the $input variable was an array in WP 2.7 (and so other variables were accessible) but it just seems to be the string imputed into the form in version 3.0 RC

    (see this tutorial for WP2.7 )

    Maybe it’s just not possible to re-use the same validation function.. but if all I have is a series of text inputs in my options, it’d be cleaner to be able to use one function than having to write the same function three times (with different variables)

Viewing 1 replies (of 1 total)
  • just call
    add_settings_error(‘options’, ‘xxxx’, ‘my error message’);
    inside the sanitizecallback function which you created

Viewing 1 replies (of 1 total)
  • The topic ‘sanitize_callback and add_settings_error() problem’ is closed to new replies.