WordPress.org

Support

Support » Plugins and Hacks » Trouble Creating Options Page

Trouble Creating Options Page

  • Tom Belknap

    @dragonflyeye

    I seem to be having a heck of a time adding in an options page for my plugin. I had no idea it would end up being this complicated.

    I’ve followed the directions here, and ended up with a form that looks like this:

    <form method="post" action="options-general.php">
    <?php wp_nonce_field('update-options') ?>
    	<input type="text" name="user_style" value="<?php echo get_option('user_style'); ?>" />
    	<input type="hidden" name="page_options" value="user_style" />
    	<p class="submit">
    		<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
    	</p>
    </form>

    But that form doesn’t submit anything, just returns me to the Options page as though nothing had happened.

    Li’l help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Tom Belknap

    @dragonflyeye

    Bump!

    Hey, could someone help a brother out, here?

    Tom Belknap

    @dragonflyeye

    Hey, could someone give me a hand, here?

    The function wp_nonce_field () is magic!
    It seems to me that you must use the tag <form> like this:
    <form method= "post" action= "options.php" >
    (not specify your file) and WP deals with all!
    If your page_options field is correct naturally…
    wp_nonce_field () includes already referer.
    It’s here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trouble Creating Options Page’ is closed to new replies.