The MU forums have moved to WordPress.org

Blog Options Not Updating, Redirection Not Working (1 post)

  1. DragonFlyEye
    Member
    Posted 16 years ago #

    OK, I don't get it. I've got a plugin I'm working on for my site that allows color substitutions in the CSS so blog users can have custom colors in their blogs. I've created a panel under Site Admin that allows the administrator to create the custom "styles" that the user can select from.

    The trouble is creating the panel for the user. Why this should be different is beyond me. I decided to use the directions found here to create an options page, but when I hit the submit button, the page redirects to the options.php file and none of the options update. I ended up with this as a super-simple form, just to see if it would work, but it is not:

    function hn_theme_styles_panel() {
    	$available = get_site_option('available_styles');
    	$selected = get_option('user_style');
    ?>
    <br />
    <form method="post" action="options.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>
    <?php
    }

    Note that the two variables declared are for populating a drop-down list that isn't there because I tried to strip everything down to it's most basic level (and also, to only those things provided in the original example).

    Everything else has gone beautifully, I don't get what is holding this portion of the process up! Thanks in advance to any of you kind enough to help me out with this one!

About this Topic

  • Started 16 years ago by DragonFlyEye