Example #1
0
function ss_inpost_metabox()
{
    $_sidebars = stripslashes_deep(get_option(SS_SETTINGS_FIELD));
    ?>

	<input type="hidden" name="ss_inpost_nonce" value="<?php 
    echo wp_create_nonce(plugin_basename(__FILE__));
    ?>
" />

	<p>
		<label class="howto" for="_ss_sidebar"><span><?php 
    _e('Primary Sidebar', 'ss');
    ?>
<span></label>
		<select name="_ss_sidebar" id="_ss_sidebar" style="width: 99%">
			<option value=""><?php 
    _e('Default', 'ss');
    ?>
</option>
			<?php 
    foreach ((array) $_sidebars as $id => $info) {
        printf('<option value="%s" %s>%s</option>', esc_html($id), selected($id, genesis_get_custom_field('_ss_sidebar'), false), esc_html($info['name']));
    }
    ?>
		</select>
	</p>
<?php 
    // don't show the option if there are no 3 column layouts registered
    if (!ss_has_3_column_layouts()) {
        return;
    }
    ?>
	<p>
		<label class="howto" for="_ss_sidebar_alt"><span><?php 
    _e('Secondary Sidebar', 'ss');
    ?>
<span></label>
		<select name="_ss_sidebar_alt" id="_ss_sidebar_alt" style="width: 99%">
			<option value=""><?php 
    _e('Default', 'ss');
    ?>
</option>
			<?php 
    foreach ((array) $_sidebars as $id => $info) {
        printf('<option value="%s" %s>%s</option>', esc_html($id), selected($id, genesis_get_custom_field('_ss_sidebar_alt'), false), esc_html($info['name']));
    }
    ?>
		</select>
	</p>

<?php 
}
function ss_term_sidebar($tag, $taxonomy)
{
    //* Merge Defaults to prevent notices
    $tag->meta = wp_parse_args($tag->meta, array('_ss_sidebar' => '', '_ss_sidebar_alt' => ''));
    //* Pull custom sidebars
    $_sidebars = stripslashes_deep(get_option(SS_SETTINGS_FIELD));
    ?>

	<h3><?php 
    _e('Sidebar Options', 'genesis-simple-sidebars');
    ?>
</h3>
	<table class="form-table">

	<tr class="form-field">
		<th scope="row" valign="top"><label for="genesis-meta[_ss_sidebar]"><?php 
    _e('Primary Sidebar', 'genesis-simple-sidebars');
    ?>
</label></th>
		<td>
			<select name="genesis-meta[_ss_sidebar]" id="genesis-meta[_ss_sidebar]" style="padding-right: 10px;">
				<option value=""><?php 
    _e('Default', 'genesis-simple-sidebars');
    ?>
</option>
				<?php 
    foreach ((array) $_sidebars as $id => $info) {
        printf('<option value="%s" %s>%s</option>', esc_html($id), selected($id, $tag->meta['_ss_sidebar'], false), esc_html($info['name']));
    }
    ?>
			</select>
		</td>
	</tr>
<?php 
    //* don't show the option if there are no 3 column layouts registered
    if (ss_has_3_column_layouts()) {
        ?>
	<tr class="form-field">
		<th scope="row" valign="top"><label for="genesis-meta[_ss_sidebar_alt]"><?php 
        _e('Secondary Sidebar', 'genesis-simple-sidebars');
        ?>
</label></th>
		<td>
			<select name="genesis-meta[_ss_sidebar_alt]" id="genesis-meta[_ss_sidebar_alt]" style="padding-right: 10px;">
				<option value=""><?php 
        _e('Default', 'genesis-simple-sidebars');
        ?>
</option>
				<?php 
        foreach ((array) $_sidebars as $id => $info) {
            printf('<option value="%s" %s>%s</option>', esc_html($id), selected($id, $tag->meta['_ss_sidebar_alt'], false), esc_html($info['name']));
        }
        ?>
			</select>
		</td>
	</tr>
<?php 
    }
    ?>
	</table>

<?php 
}