I have a form that looks as such:

<form action="options.php" method="post">
  <ul class="nav nav-tabs">
      <a href="#content" data-toggle="tab">content</a>
      <a href="#contentversion2" data-toggle="tab">content version 2</a>
  <div class="tab-content">
    <div class="tab-pane active" id="content">
      <div class="controls">
        <input type="url" name="aisis_core[index_more_posts]" placeholder="Url" />
      <div class="form-actions">
        <input type="submit" value="Submit" />
    <div class="tab-pane" id="contentversion2">
      content for this tab as well
  </div><input type="hidden" name="option_page" value="aisis_options" /><input type=
  "hidden" name="action" value="update" /><input type="hidden" id="_wpnonce" name=
  "_wpnonce" value="0360d57793" /><input type="hidden" name="_wp_http_referer" value=
  "/wordpress/wp-admin/admin.php?page=aisis-core-options&amp;settings-updated=true" />

The problem is, when I hit submit, the following options validator function is then called, based on the registered settings:

public function option_validator($input){
    var_dump($input); exit;
    $option = get_option('aitisis_core');
    $option = $input;
    update_option('success_message', true);
    return $option;

The problem as you can see from the var dump is that the input is always null....no matter what I put into the url input.

I registered the setting as such:

public function settings(){

any tips?


This kind of setup skeleton works for me to process the custom options page input :

Plugin Name: Settings Skeleton


    function call_my_settings() {
        return new MySettings();

    if (is_admin()){
        add_action( 'init', 'call_my_settings' );

    class MySettings{

        public function __construct(){
            add_action('admin_menu', array(&$this, 'add_menu'));
            add_action('admin_init', array(&$this,'settings') );

        public function add_menu(){
            add_options_page(__('My Plugin Settings','myplugindomain'), 'My Plugin Settings', 'manage_options', __FILE__,  array(&$this,'options_page'));

        public function settings() {
            register_setting( 'my_settings', 'my_settings', array(&$this,'validate') );

        public function validate($input) {
            // do validation
            return $input;

        public function options_page(){
        <div class="wrap">
            <div class="icon32" id="icon-options-general"><br></div>
            <h2><?php _e('My plugin settings','myplugindomain'); ?></h2>
            <form method="post" action="options.php">
                <?php settings_fields('my_settings'); ?>
                <?php $settings = get_option('my_settings'); ?>
                <table class="form-table">
                        <th scope="row" colspan="2">
                            <h3><?php _e('General settings','myplugindomain'); ?></h3>
                        <th scope="row"><?php _e('My text','myplugindomain'); ?> </th>
                                <input type="text" size="70" name="my_settings[mytext]" value="<?php echo $settings[mytext]; ?>" />
                <?php submit_button(); ?>

This will give you the following options page:

settings menu


How do you hook your settings() function ?

In the code example above the settings() functions is hooked into the admin_init action, i.e.

add_action('admin_init', array(&$this,'settings') );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.