Trouble Creating Options Page (4 posts)

  1. Tom Belknap
    Posted 8 years ago #

    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;') ?>" />

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

    Li'l help?

  2. Tom Belknap
    Posted 8 years ago #


    Hey, could someone help a brother out, here?

  3. Tom Belknap
    Posted 8 years ago #

    Hey, could someone give me a hand, here?

  4. arnWald
    Posted 8 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic