Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Viamultimedia on "Problem selected sidebar option for posts"

$
0
0

Hello

Well i propose a select option meta box sidebar. All sidebar apears correctly in the select options but if i go to a post and i choose a sidebar it don't save the sidebar selected for the post.

An idea please ?

public function bakerineMetaOptions() {
		global $post;
		if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id;
		$custom = get_post_custom($post->ID);
		$sidebar = $custom["sidebar"][0];
		$options = $GLOBALS['wp_registered_sidebars'];
		$selected = '"selected"';
	?>
    <select name="sidebar">
    <?php foreach ( $options as $sidebar ) : ?>
	    <option value="<?php echo $sidebar; ?>"<?php echo $selected; ?>><?php echo $sidebar['name']; ?></option>
    <?php endforeach; ?>
    </select>
    <?php
	}

Viewing all articles
Browse latest Browse all 8245

Trending Articles