mirror of
https://github.com/10h30/genesis-simple-sidebars.git
synced 2026-07-11 18:46:05 +09:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 785344b41a | |||
| 4106eb6c68 | |||
| be896fd123 | |||
| e63975e620 |
+4
-8
@@ -27,14 +27,10 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
updateDomains: true
|
||||
},
|
||||
target: {
|
||||
files: {
|
||||
src: [
|
||||
'*.php',
|
||||
'lib/**/*.php'
|
||||
]
|
||||
}
|
||||
}
|
||||
src: [
|
||||
'*.php',
|
||||
'lib/**/*.php'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ function ss_term_sidebar($tag, $taxonomy) {
|
||||
<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'] ) );
|
||||
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'] ) );
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -54,7 +54,7 @@ function ss_term_sidebar($tag, $taxonomy) {
|
||||
<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'] ) );
|
||||
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'] ) );
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
+15
-15
@@ -7,21 +7,21 @@
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-autoprefixer": "^0.8.1",
|
||||
"grunt-checktextdomain": "^0.1.1",
|
||||
"grunt-contrib-cssmin": "^0.10.0",
|
||||
"grunt-contrib-imagemin": "^0.7.1",
|
||||
"grunt-contrib-jshint": "^0.10.0",
|
||||
"grunt-contrib-uglify": "^0.5.0",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-csscomb": "~2.0.1",
|
||||
"grunt-jsbeautifier": "^0.2.7",
|
||||
"grunt-jsvalidate": "^0.2.2",
|
||||
"grunt-phplint": "0.0.5",
|
||||
"grunt-styledocco": "^0.1.4",
|
||||
"grunt-wp-i18n": "^0.4.7",
|
||||
"load-grunt-tasks": "^0.6.0"
|
||||
"grunt": "*",
|
||||
"grunt-autoprefixer": "*",
|
||||
"grunt-checktextdomain": "*",
|
||||
"grunt-contrib-cssmin": "*",
|
||||
"grunt-contrib-imagemin": "*",
|
||||
"grunt-contrib-jshint": "*",
|
||||
"grunt-contrib-uglify": "*",
|
||||
"grunt-contrib-watch": "*",
|
||||
"grunt-csscomb": "*",
|
||||
"grunt-jsbeautifier": "*",
|
||||
"grunt-jsvalidate": "*",
|
||||
"grunt-phplint": "*",
|
||||
"grunt-styledocco": "*",
|
||||
"grunt-wp-i18n": "*",
|
||||
"load-grunt-tasks": "*"
|
||||
},
|
||||
"plugin": {
|
||||
"name": "Genesis Simple Sidebars",
|
||||
|
||||
+16
-34
@@ -7,9 +7,9 @@ Author: Nathan Rice
|
||||
Author URI: http://www.nathanrice.net/
|
||||
|
||||
Text Domain: genesis-simple-sidebars
|
||||
Domain Path: /languages/
|
||||
Domain Path: /languages
|
||||
|
||||
Version: 2.0.2
|
||||
Version: 2.0.3
|
||||
|
||||
License: GNU General Public License v2.0 (or later)
|
||||
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() {
|
||||
|
||||
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.0.0', '>=' ) )
|
||||
ss_deactivate( '2.0.0', '3.6' );
|
||||
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.2.7', '>=' ) )
|
||||
ss_deactivate( '2.2.7', '4.4.2' );
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ function ss_activation_check() {
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {
|
||||
function ss_deactivate( $genesis_version = '2.2.7', $wp_version = '4.4.2' ) {
|
||||
|
||||
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 ) );
|
||||
@@ -169,39 +169,21 @@ function ss_do_sidebar_alt() {
|
||||
*/
|
||||
function ss_do_one_sidebar( $sidebar_key = '_ss_sidebar' ) {
|
||||
|
||||
static $taxonomies = null;
|
||||
|
||||
if ( is_singular() && $sidebar_key = genesis_get_custom_field( $sidebar_key ) ) {
|
||||
if ( dynamic_sidebar( $sidebar_key ) ) return true;
|
||||
}
|
||||
|
||||
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 ( is_tag() ) {
|
||||
$term = get_term( get_query_var( 'tag_id' ), 'post_tag' );
|
||||
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;
|
||||
}
|
||||
if ( dynamic_sidebar( $sidebar_key ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_tax() || is_category() || is_tag() ) {
|
||||
|
||||
if ( $sidebar_key = get_term_meta( get_queried_object()->term_id, $sidebar_key, true ) ) {
|
||||
dynamic_sidebar( $sidebar_key );
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
=== Plugin Name ===
|
||||
Contributors: nathanrice, wpmuguru
|
||||
Contributors: nathanrice, wpmuguru, studiopress
|
||||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
|
||||
Tags: hooks, genesis, genesiswp, studiopress
|
||||
Requires at least: 3.6
|
||||
|
||||
Reference in New Issue
Block a user