Data passed to the Sanitization function is empty


The seemingly related question offered not much help except for the first answer saying it could be Nonce related, but it doesn’t help in finding out how…? (neither do I understand the documentation).

The issue started after I changed my settings page to a Tabs-based page.

Although I get the “Settings saved.” alert when the page is posted but nothing gets written to the DB.

When I use the following bit of code to check for the $input that is passed to the sanitize_callback function:-

function my_sanitize ( $input ) {                   // prfx_sanitize_options( $input ) {
        $options = get_option('my_setting_section');
        $newinput = array();

        ob_start();                    // start buffer capture
        var_dump( $input );           // dump the values
        $contents = ob_get_contents(); // put the buffer into a variable
        ob_end_clean();                // end capture

NULL is printed in the error_logs.

  • If it is nonce related, how do I check it?
  • Where else can I look for problems?

Thank you!

, burf 2 years 2020-09-02T15:10:22-05:00 0 Answers 56 views 0

Leave an answer