Skip to content

Commit

Permalink
Tagging 0.9.2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrice committed Aug 9, 2013
1 parent 78faae2 commit 39f34f9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
5 changes: 1 addition & 4 deletions inpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ function ss_inpost_metabox() {
</p>
<?php
// don't show the option if there are no 3 column layouts registered
$_layouts = (array) genesis_get_layouts();
$_layouts = array_keys( $_layouts );
$_3_column = array_intersect( $_layouts, array( 'content-sidebar-sidebar', 'sidebar-content-sidebar', 'sidebar-sidebar-content' ) );
if ( empty( $_3_column ) )
if ( !ss_has_3_column_layouts() )
return;
?>
<p>
Expand Down
20 changes: 18 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Genesis Simple Sidebars
Plugin URI: http://www.studiopress.com/plugins/simple-sidebars
Description: Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas.
Version: 0.9.2
Version: 0.9.2.1
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
Text Domain: ss
Expand Down Expand Up @@ -125,7 +125,7 @@ function ss_do_one_sidebar( $bar = '_ss_sidebar' ) {

if ( is_tax() ) {
if( $taxonomies === null )
$taxonomies = (array)apply_filters( 'genesis_simple_sidebars_taxonomies', array() );
$taxonomies = ss_get_taxonomies();

foreach( $taxonomies as $tax ) {
if( $tax == 'post_tag' || $tax == 'category' )
Expand All @@ -143,3 +143,19 @@ function ss_do_one_sidebar( $bar = '_ss_sidebar' ) {
return false;

}

function ss_get_taxonomies() {

$taxonomies = get_taxonomies( array( 'show_ui' => true, 'public' => true ) );
return apply_filters( 'genesis_simple_sidebars_taxonomies', array_keys( $taxonomies ) );

}

function ss_has_3_column_layouts() {

$_layouts = (array) genesis_get_layouts();
$_layouts = array_keys( $_layouts );
$_3_column = array_intersect( $_layouts, array( 'content-sidebar-sidebar', 'sidebar-content-sidebar', 'sidebar-sidebar-content' ) );
return ! empty( $_3_column );

}
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: hooks, genesis, genesiswp, studiopress
Requires at least: 3.0
Tested up to: 3.3
Stable tag: 0.9.2
Stable tag: 0.9.2.1

This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis.

Expand Down Expand Up @@ -53,3 +53,9 @@ Not in the way you're probably thinking. The markup surrounding the widget area
* Added support for custom taxonomies
* Added translation support
* bug fix to prevent invalid sidebar creation

= 0.9.2.1 =
* Restore default tag/category support
* Default custom taxonomy support to on for public taxonomies
* Remove secondary selection when no 3 column layouts are enabled

11 changes: 8 additions & 3 deletions term.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* are passed via the hook so that we can use them.
*/
function ss_term_edit_init() {
$taxonomies = apply_filters( 'genesis_simple_sidebars_taxonomies', array() );
$taxonomies = ss_get_taxonomies();
if( !empty( $taxonomies ) && is_admin() && is_array( $taxonomies ) ) {
foreach( $taxonomies as $tax )
add_action( "{$tax}_edit_form", 'ss_term_sidebar', 9, 2 );
Expand Down Expand Up @@ -38,7 +38,10 @@ function ss_term_sidebar($tag, $taxonomy) {
</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="meta[_ss_sidebar_alt]"><?php _e('Secondary Sidebar', 'ss'); ?></label></th>
<td>
Expand All @@ -52,7 +55,9 @@ function ss_term_sidebar($tag, $taxonomy) {
</select>
</td>
</tr>

<?php
}
?>
</table>

<?php
Expand Down

0 comments on commit 39f34f9

Please sign in to comment.