The MU forums have moved to WordPress.org

themes.php submenu disappearing? (2 posts)

  1. DragonFlyEye
    Member
    Posted 16 years ago #

    OK, I keep going over things and I don't get it. I've got a plugin that allows users to select from different color schemes for their blogs, so I put the menu under the Presentation menu. However, when the form is submitted, you get dumped back at the Presentation main menu with a url like this:
    http://holisticnetworking.net/design/wp-admin/themes.php?

    Why is it stripping off the end, there? Grr!

    function hn_theme_styles_panel() {
    	$available = get_site_option('available_styles');
    	$name = 'style_';
    	$selected = '';
    	if($_POST) {
    		$selected = $_POST['new_style'];
    		$name .= strtolower(implode('_', explode(' ', $selected)));
    		update_site_option('user_style', $name);
    		?><div id='message' class='updated fade'><p><strong><?php echo($selected) ?> applied!</strong></p></div><?php
    	}
    
    	else {
    		$selected = get_option('user_style');
    	}
    ?>
    <br />
    <fieldset>
    <form action="themes.php?page=theme_styles" id="select_style">
    	<select value="new_style">
    	<option>Please Select</option>
    	<?php foreach($available as $style) {
    		?><option <?php if($style == $selected) { echo(' selected="yes"'); } ?>><?php echo($style); ?></option><?php
    	} ?>
    	</select>
    		<input type="submit" value="Load Style" />
    </form>
    </fieldset>
    <?php
    }
  2. DragonFlyEye
    Member
    Posted 16 years ago #

    Can someone help me out, here?

    I've got other functions in the same plugin that call the URL in the same way but that don't get the end stripped off the URL, so I'm really confused.

About this Topic

  • Started 16 years ago by DragonFlyEye
  • Latest reply from DragonFlyEye