5 Commits

Author SHA1 Message Date
Nathan Rice ed788e7432 Merge branch 'develop' 2015-09-29 17:19:05 -04:00
Nick Croft 7395bd6db3 don't show metabox if both sidebars disabled
addresses #9
2014-06-25 13:10:30 -04:00
Nick Croft ee29d99335 Revert "Updated to simplify admin load"
This reverts commit 5300ec9601.
2014-06-20 10:22:55 -04:00
Nick Croft 5300ec9601 Updated to simplify admin load
added a class exist check before requiring the admin.php file to ensure
that the class will exist and removed the genesis_admin_menu hook to
simplify issues when working with the global admin class object.
2014-06-20 09:59:55 -04:00
Nick Croft ff6077078d Merge branch 'develop' 2014-06-10 10:57:54 -04:00
6 changed files with 63 additions and 35 deletions
+8 -4
View File
@@ -27,10 +27,14 @@ module.exports = function(grunt) {
options: { options: {
updateDomains: true updateDomains: true
}, },
src: [ target: {
'*.php', files: {
'lib/**/*.php' src: [
] '*.php',
'lib/**/*.php'
]
}
}
} }
}, },
+6
View File
@@ -6,6 +6,12 @@ add_action('admin_menu', 'ss_add_inpost_metabox');
*/ */
function ss_add_inpost_metabox() { function ss_add_inpost_metabox() {
global $wp_registered_sidebars;
if( ! array_key_exists( 'sidebar', $wp_registered_sidebars ) && ! array_key_exists( 'sidebar-alt', $wp_registered_sidebars ) ){
return;
}
foreach ( (array) get_post_types( array( 'public' => true ) ) as $type ) { foreach ( (array) get_post_types( array( 'public' => true ) ) as $type ) {
if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) { if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) {
+2 -2
View File
@@ -37,7 +37,7 @@ function ss_term_sidebar($tag, $taxonomy) {
<option value=""><?php _e( 'Default', 'genesis-simple-sidebars' ); ?></option> <option value=""><?php _e( 'Default', 'genesis-simple-sidebars' ); ?></option>
<?php <?php
foreach ( (array) $_sidebars as $id => $info ) { foreach ( (array) $_sidebars as $id => $info ) {
printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, get_term_meta( $tag->term_id, '_ss_sidebar', true ), false), esc_html( $info['name'] ) ); printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar'] , false), esc_html( $info['name'] ) );
} }
?> ?>
</select> </select>
@@ -54,7 +54,7 @@ function ss_term_sidebar($tag, $taxonomy) {
<option value=""><?php _e( 'Default', 'genesis-simple-sidebars' ); ?></option> <option value=""><?php _e( 'Default', 'genesis-simple-sidebars' ); ?></option>
<?php <?php
foreach ( (array) $_sidebars as $id => $info ) { foreach ( (array) $_sidebars as $id => $info ) {
printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, get_term_meta( $tag->term_id, '_ss_sidebar_alt', true ), false), esc_html( $info['name'] ) ); printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar_alt'] , false), esc_html( $info['name'] ) );
} }
?> ?>
</select> </select>
+15 -15
View File
@@ -7,21 +7,21 @@
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"grunt": "*", "grunt": "^0.4.5",
"grunt-autoprefixer": "*", "grunt-autoprefixer": "^0.8.1",
"grunt-checktextdomain": "*", "grunt-checktextdomain": "^0.1.1",
"grunt-contrib-cssmin": "*", "grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-imagemin": "*", "grunt-contrib-imagemin": "^0.7.1",
"grunt-contrib-jshint": "*", "grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "*", "grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-watch": "*", "grunt-contrib-watch": "^0.6.1",
"grunt-csscomb": "*", "grunt-csscomb": "~2.0.1",
"grunt-jsbeautifier": "*", "grunt-jsbeautifier": "^0.2.7",
"grunt-jsvalidate": "*", "grunt-jsvalidate": "^0.2.2",
"grunt-phplint": "*", "grunt-phplint": "0.0.5",
"grunt-styledocco": "*", "grunt-styledocco": "^0.1.4",
"grunt-wp-i18n": "*", "grunt-wp-i18n": "^0.4.7",
"load-grunt-tasks": "*" "load-grunt-tasks": "^0.6.0"
}, },
"plugin": { "plugin": {
"name": "Genesis Simple Sidebars", "name": "Genesis Simple Sidebars",
+31 -13
View File
@@ -7,9 +7,9 @@ Author: Nathan Rice
Author URI: http://www.nathanrice.net/ Author URI: http://www.nathanrice.net/
Text Domain: genesis-simple-sidebars Text Domain: genesis-simple-sidebars
Domain Path: /languages Domain Path: /languages/
Version: 2.0.3 Version: 2.0.2
License: GNU General Public License v2.0 (or later) License: GNU General Public License v2.0 (or later)
License URI: http://www.opensource.org/licenses/gpl-license.php License URI: http://www.opensource.org/licenses/gpl-license.php
@@ -30,8 +30,8 @@ register_activation_hook( __FILE__, 'ss_activation_check' );
*/ */
function ss_activation_check() { function ss_activation_check() {
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.2.7', '>=' ) ) if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.0.0', '>=' ) )
ss_deactivate( '2.2.7', '4.4.2' ); ss_deactivate( '2.0.0', '3.6' );
} }
@@ -42,7 +42,7 @@ function ss_activation_check() {
* *
* @since 1.0.0 * @since 1.0.0
*/ */
function ss_deactivate( $genesis_version = '2.2.7', $wp_version = '4.4.2' ) { function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'genesis-simple-sidebars' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) ); wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'genesis-simple-sidebars' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) );
@@ -169,19 +169,37 @@ function ss_do_sidebar_alt() {
*/ */
function ss_do_one_sidebar( $sidebar_key = '_ss_sidebar' ) { function ss_do_one_sidebar( $sidebar_key = '_ss_sidebar' ) {
static $taxonomies = null;
if ( is_singular() && $sidebar_key = genesis_get_custom_field( $sidebar_key ) ) { if ( is_singular() && $sidebar_key = genesis_get_custom_field( $sidebar_key ) ) {
if ( dynamic_sidebar( $sidebar_key ) ) { if ( dynamic_sidebar( $sidebar_key ) ) return true;
return true;
}
} }
if ( is_tax() || is_category() || is_tag() ) { if ( is_category() ) {
$term = get_term( get_query_var( 'cat' ), 'category' );
if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true;
}
if ( $sidebar_key = get_term_meta( get_queried_object()->term_id, $sidebar_key, true ) ) { if ( is_tag() ) {
dynamic_sidebar( $sidebar_key ); $term = get_term( get_query_var( 'tag_id' ), 'post_tag' );
return true; if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true;
}
if ( is_tax() ) {
if ( null === $taxonomies )
$taxonomies = ss_get_taxonomies();
foreach ( $taxonomies as $tax ) {
if ( 'post_tag' == $tax || 'category' == $tax )
continue;
if ( is_tax( $tax ) ) {
$obj = get_queried_object();
$term = get_term( $obj->term_id, $tax );
if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true;
break;
}
} }
} }
return false; return false;
+1 -1
View File
@@ -1,5 +1,5 @@
=== Plugin Name === === Plugin Name ===
Contributors: nathanrice, wpmuguru, studiopress Contributors: nathanrice, wpmuguru
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
Tags: hooks, genesis, genesiswp, studiopress Tags: hooks, genesis, genesiswp, studiopress
Requires at least: 3.6 Requires at least: 3.6