Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

after saving my options for my plugin I am getting the options page not found error. After some research, I found, that I may have forgotten to register my option or registered the wrong one. I checked my code, but I do not find the mistake:

in settings.php

/**
* Register and add settings
*/
public function page_init()
{        
    register_setting(
        'general', // Option group
        'my_connect_options' // Option name
        //array( $this, 'sanitize' ) // Sanitize
    );

    add_settings_section(
        'general', // ID
        'General Settings', // Title
        array( $this, 'callback_general_section' ), // Callback
        'my_connect_settings' // Page
    );  

    add_settings_field(
        'email', // ID
        __('Email Adress'), // Title 
        array( $this, 'email_callback' ), // Callback
        'my_connect_settings', // Page
        'general' // Section           
    );
}

public function callback_general_section()
{
    _e('Set you general settings here.');
}

public function email_callback()
{
    printf( '<input type="email" id="email" name="my_connect_options[email]" value="%s" />',
    isset( $this->options['email'] ) ? esc_attr( $this->options['email']) : '');
}

and in plugin.php

public static function init()
{
    add_option('my_connect_options');
...

init() is called by the plugins_loaded hook. page_init is called by the admin_init hook

share|improve this question
    
Please narrow the scope of your question, and show what you've done to troubleshoot. –  Chip Bennett Oct 14 '13 at 19:43
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.