Support » Fixing WordPress » Options page XXX not found in the allowed options list

  • Resolved joho68

    (@joho68)


    Apologies if this has been asked before, but I haven’t been able to find any errors/solutions that match this issue.

    So I have a plugin, XXX, it has worked for a number of WordPress releases. And then, at some point, maybe WP56, or WP57, not sure, it started exhibiting this error. I’m now running WP58, and when I go to the configuration page, and choose to save its options, and am greeted by a fatal WordPress error:

    “Error: Options page XXX_settings not found in the allowed options list.”

    I understand what WordPress wants to check, but I don’t understand why the check is failing.

    In my function that sets up the options, I’ve dumped $GLOBALS[‘new_whitelist_options’] before I add my settings, and I’ve dumped it after. In the after-dump, it properly contains a XXX_settings index, with a number of options that I have added.

    I have a number of other plugins I’m responsible for, with *identical* code (apart from that it’s not caled XXX and XXX_settings is called something else), and none of them exhibit this behavior.

    The options page is added with add_options_page(‘Title’,’MenuTitle’,’manage_options’,’XXX’);

    Options/Sections are painted with settings_fields(‘XXX_settings’) and do_settings_sections(‘XXX_settings’).

    Settings are added with add_settings_fields(), using ‘XXX_settings’, and register_setting() with ‘XXX_settings’.

    So, where would be a good place to start looking for my error? 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter joho68

    (@joho68)

    The error is triggered here:

    	if ( ! isset( $allowed_options[ $option_page ] ) ) {
    		wp_die(
    			sprintf(
    				/* translators: %s: The options page name. */
    				__( '<strong>Error</strong>: Options page %s not found in the allowed options list.' ),
    				'<code>' . esc_html( $option_page ) . '</code>'
    			)
    		);
    	}
    

    in wp-admin/options.php

Viewing 1 replies (of 1 total)
  • The topic ‘Options page XXX not found in the allowed options list’ is closed to new replies.