1 Commits

Author SHA1 Message Date
Nathan Rice 785344b41a Update plugin for new term meta method. 2016-04-19 11:36:09 -04:00
7 changed files with 33 additions and 55 deletions
+6 -6
View File
@@ -20,7 +20,7 @@ module.exports = function(grunt) {
// I18n // I18n
// Add text domain as last argument of i18n functions // Add text domain as last argument of i18n functions
addtextdomain: { addtextdomain: {
php: { php: {
@@ -43,15 +43,15 @@ module.exports = function(grunt) {
'_e:1,2d', '_e:1,2d',
'_x:1,2c,3d', '_x:1,2c,3d',
'_ex:1,2c,3d', '_ex:1,2c,3d',
'_n:1,2,4d', '_n:1,2,4d',
'_nx:1,2,4c,5d', '_nx:1,2,4c,5d',
'_n_noop:1,2,3d', '_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d', '_nx_noop:1,2,3c,4d',
'esc_attr__:1,2d', 'esc_attr__:1,2d',
'esc_html__:1,2d', 'esc_html__:1,2d',
'esc_attr_e:1,2d', 'esc_attr_e:1,2d',
'esc_html_e:1,2d', 'esc_html_e:1,2d',
'esc_attr_x:1,2c,3d', 'esc_attr_x:1,2c,3d',
'esc_html_x:1,2c,3d' 'esc_html_x:1,2c,3d'
] ]
}, },
@@ -75,7 +75,7 @@ module.exports = function(grunt) {
pot.headers['last-translator'] = 'StudioPress <translations@studiopress.com>'; pot.headers['last-translator'] = 'StudioPress <translations@studiopress.com>';
pot.headers['language-team'] = 'English <translations@studiopress.com>'; pot.headers['language-team'] = 'English <translations@studiopress.com>';
pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;'; pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;';
pot.headers['x-generator'] = 'grunt-wp-i18n'; pot.headers['x-generator'] = 'grunt-wp-i18n 0.4.4';
pot.headers['x-poedit-basepath'] = '.'; pot.headers['x-poedit-basepath'] = '.';
pot.headers['x-poedit-language'] = 'English'; pot.headers['x-poedit-language'] = 'English';
pot.headers['x-poedit-country'] = 'UNITED STATES'; pot.headers['x-poedit-country'] = 'UNITED STATES';
+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, $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> </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, $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> </select>
+1 -1
View File
@@ -22,7 +22,7 @@ screen_icon( 'themes' ); ?>
<tr class="form-field"> <tr class="form-field">
<th scope="row" valign="top"><label for="edit_sidebar[id]"><?php _e( 'ID', 'genesis-simple-sidebars' ); ?></label></th> <th scope="row" valign="top"><label for="edit_sidebar[id]"><?php _e( 'ID', 'genesis-simple-sidebars' ); ?></label></th>
<td> <td>
<input type="text" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" readonly /> <input type="text" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" disabled="disabled" />
<input name="edit_sidebar[id]" id="edit_sidebar[id]" type="hidden" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" /> <input name="edit_sidebar[id]" id="edit_sidebar[id]" type="hidden" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" />
<p class="description"><?php _e( 'The unique ID is used to register the sidebar widget area (cannot be changed)', 'genesis-simple-sidebars' ); ?></p></td> <p class="description"><?php _e( 'The unique ID is used to register the sidebar widget area (cannot be changed)', 'genesis-simple-sidebars' ); ?></p></td>
</tr> </tr>
+5 -5
View File
@@ -1,17 +1,17 @@
# Copyright (C) 2016 Nathan Rice # Copyright (C) 2015 Nathan Rice
# This file is distributed under the GNU General Public License v2.0 (or later). # This file is distributed under the GNU General Public License v2.0 (or later).
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Genesis Simple Sidebars 2.0.3\n" "Project-Id-Version: Genesis Simple Sidebars 2.0.2\n"
"Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n" "Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
"POT-Creation-Date: 2016-02-24 19:51:21+00:00\n" "POT-Creation-Date: 2015-09-29 20:53:32+00:00\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
"Last-Translator: StudioPress <translations@studiopress.com>\n" "Last-Translator: StudioPress <translations@studiopress.com>\n"
"Language-Team: English <translations@studiopress.com>\n" "Language-Team: English <translations@studiopress.com>\n"
"X-Generator: grunt-wp-i18n\n" "X-Generator: grunt-wp-i18n 0.4.4\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-Basepath: .\n" "X-Poedit-Basepath: .\n"
"X-Poedit-Language: English\n" "X-Poedit-Language: English\n"
+1 -1
View File
@@ -29,7 +29,7 @@
"description": "Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas.", "description": "Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas.",
"author": "StudioPress", "author": "StudioPress",
"authoruri": "http://www.studiopress.com/", "authoruri": "http://www.studiopress.com/",
"version": "2.0.3", "version": "2.0.2",
"license": "GPL-2.0+", "license": "GPL-2.0+",
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html", "licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
"textdomain": "genesis-simple-sidebars" "textdomain": "genesis-simple-sidebars"
+15 -33
View File
@@ -9,7 +9,7 @@ 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.2 Version: 2.0.3
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.0.0', '>=' ) ) if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.2.7', '>=' ) )
ss_deactivate( '2.0.0', '3.6' ); ss_deactivate( '2.2.7', '4.4.2' );
} }
@@ -42,7 +42,7 @@ function ss_activation_check() {
* *
* @since 1.0.0 * @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__ ) ); 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,39 +169,21 @@ 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 ) ) return true; 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 ( 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; return false;
} }
+3 -7
View File
@@ -2,9 +2,9 @@
Contributors: nathanrice, wpmuguru, studiopress Contributors: nathanrice, wpmuguru, studiopress
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: 4.4.2 Requires at least: 3.6
Tested up to: 4.4.2 Tested up to: 4.3.1
Stable tag: 2.0.3 Stable tag: 2.0.2
This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis.
@@ -37,10 +37,6 @@ Not in the way you're probably thinking. The markup surrounding the widget area
== Changelog == == Changelog ==
= 2.0.3 =
* Update for WordPress 4.4+ and Genesis 2.2.7+
* DO NOT upgrade to 2.0.3 unless you are running WordPress 4.4+ AND Genesis 2.2.7+
= 2.0.2 = = 2.0.2 =
* Change text domain, update POT file. * Change text domain, update POT file.