Version Description
Updated for WordPress 3.5+ compatibility. Adjusted "Advanced" tab logic. Fixed bug where "Template Hierarchy -> Pages" condition wasn't being applied correctly. Dequeue WordPress SEO admin stylesheets from the "Widget Areas" "Add" and "Edit" screens.
Download this release
Release Info
| Developer | mattyza |
| Plugin | |
| Version | 1.2.1 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.0 to 1.2.1
- assets/js/admin.js +2 -2
- changelog.txt +5 -0
- classes/class-woo-conditions.php +24 -11
- classes/class-woo-sidebars.php +22 -16
- readme.txt +16 -2
- woosidebars.php +3 -3
assets/js/admin.js
CHANGED
|
@@ -3,10 +3,10 @@ jQuery( document ).ready( function () {
|
|
| 3 |
jQuery( '.woo-conditions.tabs .inner-tabs' ).tabs();
|
| 4 |
|
| 5 |
jQuery( '#woo-conditions .advanced-settings a' ).click( function ( e ) {
|
| 6 |
-
jQuery(
|
| 7 |
|
| 8 |
var new_status = '1'; // Do display.
|
| 9 |
-
if ( jQuery(
|
| 10 |
new_status = '0'; // Don't display.
|
| 11 |
}
|
| 12 |
|
| 3 |
jQuery( '.woo-conditions.tabs .inner-tabs' ).tabs();
|
| 4 |
|
| 5 |
jQuery( '#woo-conditions .advanced-settings a' ).click( function ( e ) {
|
| 6 |
+
jQuery( '#woo-conditions .tabs li.advanced' ).toggleClass( 'hide' );
|
| 7 |
|
| 8 |
var new_status = '1'; // Do display.
|
| 9 |
+
if ( jQuery( '#woo-conditions .tabs li.advanced' ).hasClass( 'hide' ) ) {
|
| 10 |
new_status = '0'; // Don't display.
|
| 11 |
}
|
| 12 |
|
changelog.txt
CHANGED
|
@@ -1,5 +1,10 @@
|
|
| 1 |
*** WooSidebars Changelog ***
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
2012.08.14 - version 1.1.2
|
| 4 |
* /integrations/integration-woocommerce.php - Added logic to stop undefined index notices in foreach(). Prevent direct file access.
|
| 5 |
* /classes/class.wooconditions.php,
|
| 1 |
*** WooSidebars Changelog ***
|
| 2 |
|
| 3 |
+
2013.01.09 - version 1.2.1
|
| 4 |
+
* /classes/class-woo-conditions.php - Update script version. Update conditions meta box HTML to move the "advanced" button to it's own list instead of being a part of the tabs. Add "post_type" condition without the "post-type-" prefix. Fixes the "Template Hierarchy -> Pages" bug.
|
| 5 |
+
* /classes/class-woo-sidebars.php - If WordPress SEO is active, remove the unused meta box styling, as it conflicts with the custom WooSidebars meta box styling. Set "has_archive" to "sidebars". Make sure only users with the "switch_themes" capability can see the "Widget Areas" admin menu.
|
| 6 |
+
* /assets/js/admin.js - Adjust admin JavaScript to work with updated conditions meta box HTML.
|
| 7 |
+
|
| 8 |
2012.08.14 - version 1.1.2
|
| 9 |
* /integrations/integration-woocommerce.php - Added logic to stop undefined index notices in foreach(). Prevent direct file access.
|
| 10 |
* /classes/class.wooconditions.php,
|
classes/class-woo-conditions.php
CHANGED
|
@@ -110,10 +110,14 @@ class Woo_Conditions {
|
|
| 110 |
$conditions = array();
|
| 111 |
$conditions_headings = array();
|
| 112 |
|
|
|
|
|
|
|
|
|
|
| 113 |
// Pages
|
| 114 |
$conditions['pages'] = array();
|
| 115 |
|
| 116 |
-
$
|
|
|
|
| 117 |
|
| 118 |
if ( count( $pages ) > 0 ) {
|
| 119 |
|
|
@@ -121,8 +125,13 @@ class Woo_Conditions {
|
|
| 121 |
|
| 122 |
foreach ( $pages as $k => $v ) {
|
| 123 |
$token = 'post-' . $v->ID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
$conditions['pages'][$token] = array(
|
| 125 |
-
'label' => $
|
| 126 |
'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title )
|
| 127 |
);
|
| 128 |
}
|
|
@@ -153,7 +162,6 @@ class Woo_Conditions {
|
|
| 153 |
}
|
| 154 |
|
| 155 |
// Add per-post support for any post type that supports it.
|
| 156 |
-
|
| 157 |
$args = array(
|
| 158 |
'show_ui' => true,
|
| 159 |
'public' => true,
|
|
@@ -169,20 +177,24 @@ class Woo_Conditions {
|
|
| 169 |
break;
|
| 170 |
}
|
| 171 |
}
|
| 172 |
-
|
| 173 |
foreach ( $post_types as $k => $v ) {
|
| 174 |
if ( ! post_type_supports( $k, 'woosidebars' ) ) { continue; }
|
| 175 |
|
| 176 |
$conditions_headings[$k] = $v->labels->name;
|
| 177 |
|
| 178 |
-
$query_args = array( 'numberposts' => -1, 'post_type' => $k, 'meta_key' => '_enable_sidebar', 'meta_value' => 'yes', 'meta_compare' => '=' );
|
| 179 |
|
| 180 |
$posts = get_posts( $query_args );
|
| 181 |
|
| 182 |
if ( count( $posts ) > 0 ) {
|
| 183 |
foreach ( $posts as $i => $j ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
$conditions[$k]['post' . '-' . $j->ID] = array(
|
| 185 |
-
'label' => $
|
| 186 |
'description' => sprintf( __( 'A custom sidebar for "%s"', 'woosidebars' ), esc_attr( $j->post_title ) )
|
| 187 |
);
|
| 188 |
}
|
|
@@ -228,7 +240,7 @@ class Woo_Conditions {
|
|
| 228 |
foreach ( $post_types as $k => $v ) {
|
| 229 |
$token = 'post-type-' . $k;
|
| 230 |
$conditions['post_types'][$token] = array(
|
| 231 |
-
'label' => sprintf( __( 'Individual %s', 'woosidebars' ), $v->labels->
|
| 232 |
'description' => sprintf( __( 'Entries in the "%s" post type', 'woosidebars' ), $v->labels->name )
|
| 233 |
);
|
| 234 |
}
|
|
@@ -354,6 +366,7 @@ class Woo_Conditions {
|
|
| 354 |
if ( is_singular() ) {
|
| 355 |
$this->conditions[] = 'singular';
|
| 356 |
$this->conditions[] = 'post-type-' . get_post_type();
|
|
|
|
| 357 |
|
| 358 |
$categories = get_the_category( get_the_ID() );
|
| 359 |
|
|
@@ -490,7 +503,7 @@ class Woo_Conditions {
|
|
| 490 |
|
| 491 |
$html .= '<div id="taxonomy-category" class="categorydiv tabs woo-conditions">' . "\n";
|
| 492 |
|
| 493 |
-
$html .= '<ul id="category-tabs" class="conditions-tabs">' . "\n";
|
| 494 |
|
| 495 |
$count = 0;
|
| 496 |
|
|
@@ -523,10 +536,10 @@ class Woo_Conditions {
|
|
| 523 |
|
| 524 |
$class = 'hide-if-no-js advanced';
|
| 525 |
if ( ! $show_advanced ) { $class .= ' hide'; }
|
| 526 |
-
|
| 527 |
-
$html .= '<li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li>' . "\n";
|
| 528 |
|
| 529 |
$html .= '</ul>' . "\n";
|
|
|
|
|
|
|
| 530 |
|
| 531 |
foreach ( $this->conditions_reference as $k => $v ) {
|
| 532 |
$count = 0;
|
|
@@ -702,7 +715,7 @@ class Woo_Conditions {
|
|
| 702 |
if ( get_post_type() != $this->token ) { return; }
|
| 703 |
|
| 704 |
if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
|
| 705 |
-
wp_register_script( $this->token . '-admin', $this->assets_url . '/js/admin.js', array( 'jquery', 'jquery-ui-tabs' ), '1.
|
| 706 |
|
| 707 |
wp_enqueue_script( $this->token . '-admin' );
|
| 708 |
|
| 110 |
$conditions = array();
|
| 111 |
$conditions_headings = array();
|
| 112 |
|
| 113 |
+
// Get an array of the different post status labels, in case we need it later.
|
| 114 |
+
$post_statuses = get_post_statuses();
|
| 115 |
+
|
| 116 |
// Pages
|
| 117 |
$conditions['pages'] = array();
|
| 118 |
|
| 119 |
+
$statuses_string = join( ',', array_keys( $post_statuses ) );
|
| 120 |
+
$pages = get_pages( array( 'post_status' => $statuses_string ) );
|
| 121 |
|
| 122 |
if ( count( $pages ) > 0 ) {
|
| 123 |
|
| 125 |
|
| 126 |
foreach ( $pages as $k => $v ) {
|
| 127 |
$token = 'post-' . $v->ID;
|
| 128 |
+
$label = $v->post_title;
|
| 129 |
+
if ( 'publish' != $v->post_status ) {
|
| 130 |
+
$label .= ' <strong>(' . $post_statuses[$v->post_status] . ')</strong>';
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
$conditions['pages'][$token] = array(
|
| 134 |
+
'label' => $label,
|
| 135 |
'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title )
|
| 136 |
);
|
| 137 |
}
|
| 162 |
}
|
| 163 |
|
| 164 |
// Add per-post support for any post type that supports it.
|
|
|
|
| 165 |
$args = array(
|
| 166 |
'show_ui' => true,
|
| 167 |
'public' => true,
|
| 177 |
break;
|
| 178 |
}
|
| 179 |
}
|
| 180 |
+
|
| 181 |
foreach ( $post_types as $k => $v ) {
|
| 182 |
if ( ! post_type_supports( $k, 'woosidebars' ) ) { continue; }
|
| 183 |
|
| 184 |
$conditions_headings[$k] = $v->labels->name;
|
| 185 |
|
| 186 |
+
$query_args = array( 'numberposts' => -1, 'post_type' => $k, 'meta_key' => '_enable_sidebar', 'meta_value' => 'yes', 'meta_compare' => '=', 'post_status' => 'any' );
|
| 187 |
|
| 188 |
$posts = get_posts( $query_args );
|
| 189 |
|
| 190 |
if ( count( $posts ) > 0 ) {
|
| 191 |
foreach ( $posts as $i => $j ) {
|
| 192 |
+
$label = $j->post_title;
|
| 193 |
+
if ( 'publish' != $j->post_status ) {
|
| 194 |
+
$label .= ' <strong>(' . $post_statuses[$j->post_status] . ')</strong>';
|
| 195 |
+
}
|
| 196 |
$conditions[$k]['post' . '-' . $j->ID] = array(
|
| 197 |
+
'label' => $label,
|
| 198 |
'description' => sprintf( __( 'A custom sidebar for "%s"', 'woosidebars' ), esc_attr( $j->post_title ) )
|
| 199 |
);
|
| 200 |
}
|
| 240 |
foreach ( $post_types as $k => $v ) {
|
| 241 |
$token = 'post-type-' . $k;
|
| 242 |
$conditions['post_types'][$token] = array(
|
| 243 |
+
'label' => sprintf( __( 'Each Individual %s', 'woosidebars' ), $v->labels->singular_name ),
|
| 244 |
'description' => sprintf( __( 'Entries in the "%s" post type', 'woosidebars' ), $v->labels->name )
|
| 245 |
);
|
| 246 |
}
|
| 366 |
if ( is_singular() ) {
|
| 367 |
$this->conditions[] = 'singular';
|
| 368 |
$this->conditions[] = 'post-type-' . get_post_type();
|
| 369 |
+
$this->conditions[] = get_post_type();
|
| 370 |
|
| 371 |
$categories = get_the_category( get_the_ID() );
|
| 372 |
|
| 503 |
|
| 504 |
$html .= '<div id="taxonomy-category" class="categorydiv tabs woo-conditions">' . "\n";
|
| 505 |
|
| 506 |
+
$html .= '<ul id="category-tabs" class="conditions-tabs alignleft">' . "\n";
|
| 507 |
|
| 508 |
$count = 0;
|
| 509 |
|
| 536 |
|
| 537 |
$class = 'hide-if-no-js advanced';
|
| 538 |
if ( ! $show_advanced ) { $class .= ' hide'; }
|
|
|
|
|
|
|
| 539 |
|
| 540 |
$html .= '</ul>' . "\n";
|
| 541 |
+
|
| 542 |
+
$html .= '<ul class="conditions-tabs"><li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li></ul>' . "\n";
|
| 543 |
|
| 544 |
foreach ( $this->conditions_reference as $k => $v ) {
|
| 545 |
$count = 0;
|
| 715 |
if ( get_post_type() != $this->token ) { return; }
|
| 716 |
|
| 717 |
if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
|
| 718 |
+
wp_register_script( $this->token . '-admin', $this->assets_url . '/js/admin.js', array( 'jquery', 'jquery-ui-tabs' ), '1.2.1', true );
|
| 719 |
|
| 720 |
wp_enqueue_script( $this->token . '-admin' );
|
| 721 |
|
classes/class-woo-sidebars.php
CHANGED
|
@@ -121,7 +121,7 @@ class Woo_Sidebars {
|
|
| 121 |
// Run this on activation.
|
| 122 |
register_activation_hook( $this->file, array( &$this, 'activation' ) );
|
| 123 |
} // End init()
|
| 124 |
-
|
| 125 |
/**
|
| 126 |
* register_post_type_columns function.
|
| 127 |
*
|
|
@@ -144,7 +144,10 @@ class Woo_Sidebars {
|
|
| 144 |
* @access public
|
| 145 |
* @return void
|
| 146 |
*/
|
| 147 |
-
public function register_post_type () {
|
|
|
|
|
|
|
|
|
|
| 148 |
$page = 'themes.php';
|
| 149 |
|
| 150 |
$singular = __( 'Widget Area', 'woosidebars' );
|
|
@@ -181,7 +184,7 @@ class Woo_Sidebars {
|
|
| 181 |
'query_var' => true,
|
| 182 |
'rewrite' => $rewrite,
|
| 183 |
'capability_type' => 'post',
|
| 184 |
-
'has_archive' =>
|
| 185 |
'hierarchical' => false,
|
| 186 |
'menu_position' => null,
|
| 187 |
'supports' => $supports
|
|
@@ -333,7 +336,7 @@ class Woo_Sidebars {
|
|
| 333 |
global $post, $messages;
|
| 334 |
|
| 335 |
// Verify
|
| 336 |
-
if ( ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_noonce'], plugin_basename(__FILE__) ) ) {
|
| 337 |
return $post_id;
|
| 338 |
}
|
| 339 |
|
|
@@ -601,15 +604,24 @@ class Woo_Sidebars {
|
|
| 601 |
wp_enqueue_style( 'jquery-ui-tabs' );
|
| 602 |
|
| 603 |
wp_register_style( $this->token . '-admin', $this->assets_url . '/css/admin.css', array(), '1.0.0' );
|
| 604 |
-
|
| 605 |
wp_enqueue_style( $this->token . '-admin' );
|
| 606 |
|
| 607 |
wp_dequeue_style( 'jquery-ui-datepicker' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 608 |
}
|
| 609 |
|
| 610 |
if ( in_array( $pagenow, array( 'edit.php' ) ) ) {
|
| 611 |
wp_register_style( $this->token . '-admin-posts', $this->assets_url . '/css/admin-posts.css', array(), '1.0.0' );
|
| 612 |
-
|
| 613 |
wp_enqueue_style( $this->token . '-admin-posts' );
|
| 614 |
}
|
| 615 |
} // End enqueue_styles()
|
|
@@ -636,11 +648,9 @@ class Woo_Sidebars {
|
|
| 636 |
*/
|
| 637 |
public function add_post_column_data ( $column_name, $id ) {
|
| 638 |
global $wpdb, $post;
|
| 639 |
-
|
| 640 |
$meta = get_post_custom( $id );
|
| 641 |
|
| 642 |
switch ( $column_name ) {
|
| 643 |
-
|
| 644 |
case 'woosidebars_enable':
|
| 645 |
$image = 'success-off';
|
| 646 |
$value = '';
|
|
@@ -652,7 +662,6 @@ class Woo_Sidebars {
|
|
| 652 |
}
|
| 653 |
|
| 654 |
$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woosidebars-post-enable&post_id=' . $post->ID ), 'woosidebars-post-enable' );
|
| 655 |
-
|
| 656 |
$value = '<span class="' . esc_attr( $class ) . '"><a href="' . esc_url( $url ) . '"><img src="' . $this->assets_url . '/images/' . $image . '.png" /></a></span>';
|
| 657 |
|
| 658 |
echo $value;
|
|
@@ -660,7 +669,6 @@ class Woo_Sidebars {
|
|
| 660 |
|
| 661 |
default:
|
| 662 |
break;
|
| 663 |
-
|
| 664 |
}
|
| 665 |
} // End add_post_column_data()
|
| 666 |
|
|
@@ -672,9 +680,7 @@ class Woo_Sidebars {
|
|
| 672 |
*/
|
| 673 |
public function enable_custom_post_sidebars () {
|
| 674 |
if( ! is_admin() ) die;
|
| 675 |
-
|
| 676 |
if( ! current_user_can( 'edit_posts' ) ) wp_die( __( 'You do not have sufficient permissions to access this page.', 'woosidebars' ) );
|
| 677 |
-
|
| 678 |
if( ! check_admin_referer( 'woosidebars-post-enable' ) ) wp_die( __( 'You have taken too long. Please go back and retry.', 'woosidebars' ) );
|
| 679 |
|
| 680 |
$post_id = isset( $_GET['post_id'] ) && (int)$_GET['post_id'] ? (int)$_GET['post_id'] : '';
|
|
@@ -705,11 +711,11 @@ class Woo_Sidebars {
|
|
| 705 |
* @return string $m
|
| 706 |
*/
|
| 707 |
public function multidimensional_search ( $needle, $haystack ) {
|
| 708 |
-
if (empty($needle) || empty($haystack)) {
|
| 709 |
return false;
|
| 710 |
}
|
| 711 |
|
| 712 |
-
foreach ($haystack as $key => $value) {
|
| 713 |
$exists = 0;
|
| 714 |
foreach ( (array)$needle as $nkey => $nvalue) {
|
| 715 |
if ( ! empty( $value[$nvalue] ) && is_array( $value[$nvalue] ) ) {
|
|
@@ -754,8 +760,8 @@ class Woo_Sidebars {
|
|
| 754 |
|
| 755 |
get_current_screen()->set_help_sidebar(
|
| 756 |
'<p><strong>' . __( 'For more information:', 'woosidebars' ) . '</strong></p>' .
|
| 757 |
-
'<p><a href="http://support.woothemes.com/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'Support
|
| 758 |
-
'<p><a href="http://woothemes.com/
|
| 759 |
);
|
| 760 |
} // End add_contextual_help()
|
| 761 |
|
| 121 |
// Run this on activation.
|
| 122 |
register_activation_hook( $this->file, array( &$this, 'activation' ) );
|
| 123 |
} // End init()
|
| 124 |
+
|
| 125 |
/**
|
| 126 |
* register_post_type_columns function.
|
| 127 |
*
|
| 144 |
* @access public
|
| 145 |
* @return void
|
| 146 |
*/
|
| 147 |
+
public function register_post_type () {
|
| 148 |
+
// Allow only users who can adjust the theme to view the WooSidebars admin.
|
| 149 |
+
if ( ! current_user_can( 'switch_themes' ) ) return;
|
| 150 |
+
|
| 151 |
$page = 'themes.php';
|
| 152 |
|
| 153 |
$singular = __( 'Widget Area', 'woosidebars' );
|
| 184 |
'query_var' => true,
|
| 185 |
'rewrite' => $rewrite,
|
| 186 |
'capability_type' => 'post',
|
| 187 |
+
'has_archive' => 'sidebars',
|
| 188 |
'hierarchical' => false,
|
| 189 |
'menu_position' => null,
|
| 190 |
'supports' => $supports
|
| 336 |
global $post, $messages;
|
| 337 |
|
| 338 |
// Verify
|
| 339 |
+
if ( ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_noonce'], plugin_basename( __FILE__ ) ) ) {
|
| 340 |
return $post_id;
|
| 341 |
}
|
| 342 |
|
| 604 |
wp_enqueue_style( 'jquery-ui-tabs' );
|
| 605 |
|
| 606 |
wp_register_style( $this->token . '-admin', $this->assets_url . '/css/admin.css', array(), '1.0.0' );
|
|
|
|
| 607 |
wp_enqueue_style( $this->token . '-admin' );
|
| 608 |
|
| 609 |
wp_dequeue_style( 'jquery-ui-datepicker' );
|
| 610 |
+
|
| 611 |
+
if ( class_exists( 'WPSEO_Metabox' ) ) {
|
| 612 |
+
// Dequeue unused WordPress SEO CSS files.
|
| 613 |
+
wp_dequeue_style( 'edit-page' );
|
| 614 |
+
wp_dequeue_style( 'metabox-tabs' );
|
| 615 |
+
|
| 616 |
+
$color = get_user_meta( get_current_user_id(), 'admin_color', true );
|
| 617 |
+
if ( '' == $color ) $color = 'fresh';
|
| 618 |
+
|
| 619 |
+
wp_dequeue_style( 'metabox-' . $color );
|
| 620 |
+
}
|
| 621 |
}
|
| 622 |
|
| 623 |
if ( in_array( $pagenow, array( 'edit.php' ) ) ) {
|
| 624 |
wp_register_style( $this->token . '-admin-posts', $this->assets_url . '/css/admin-posts.css', array(), '1.0.0' );
|
|
|
|
| 625 |
wp_enqueue_style( $this->token . '-admin-posts' );
|
| 626 |
}
|
| 627 |
} // End enqueue_styles()
|
| 648 |
*/
|
| 649 |
public function add_post_column_data ( $column_name, $id ) {
|
| 650 |
global $wpdb, $post;
|
|
|
|
| 651 |
$meta = get_post_custom( $id );
|
| 652 |
|
| 653 |
switch ( $column_name ) {
|
|
|
|
| 654 |
case 'woosidebars_enable':
|
| 655 |
$image = 'success-off';
|
| 656 |
$value = '';
|
| 662 |
}
|
| 663 |
|
| 664 |
$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woosidebars-post-enable&post_id=' . $post->ID ), 'woosidebars-post-enable' );
|
|
|
|
| 665 |
$value = '<span class="' . esc_attr( $class ) . '"><a href="' . esc_url( $url ) . '"><img src="' . $this->assets_url . '/images/' . $image . '.png" /></a></span>';
|
| 666 |
|
| 667 |
echo $value;
|
| 669 |
|
| 670 |
default:
|
| 671 |
break;
|
|
|
|
| 672 |
}
|
| 673 |
} // End add_post_column_data()
|
| 674 |
|
| 680 |
*/
|
| 681 |
public function enable_custom_post_sidebars () {
|
| 682 |
if( ! is_admin() ) die;
|
|
|
|
| 683 |
if( ! current_user_can( 'edit_posts' ) ) wp_die( __( 'You do not have sufficient permissions to access this page.', 'woosidebars' ) );
|
|
|
|
| 684 |
if( ! check_admin_referer( 'woosidebars-post-enable' ) ) wp_die( __( 'You have taken too long. Please go back and retry.', 'woosidebars' ) );
|
| 685 |
|
| 686 |
$post_id = isset( $_GET['post_id'] ) && (int)$_GET['post_id'] ? (int)$_GET['post_id'] : '';
|
| 711 |
* @return string $m
|
| 712 |
*/
|
| 713 |
public function multidimensional_search ( $needle, $haystack ) {
|
| 714 |
+
if (empty( $needle ) || empty( $haystack ) ) {
|
| 715 |
return false;
|
| 716 |
}
|
| 717 |
|
| 718 |
+
foreach ( $haystack as $key => $value ) {
|
| 719 |
$exists = 0;
|
| 720 |
foreach ( (array)$needle as $nkey => $nvalue) {
|
| 721 |
if ( ! empty( $value[$nvalue] ) && is_array( $value[$nvalue] ) ) {
|
| 760 |
|
| 761 |
get_current_screen()->set_help_sidebar(
|
| 762 |
'<p><strong>' . __( 'For more information:', 'woosidebars' ) . '</strong></p>' .
|
| 763 |
+
'<p><a href="http://support.woothemes.com/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'Support HelpDesk', 'woosidebars' ) . '</a></p>' .
|
| 764 |
+
'<p><a href="http://dojodocs.woothemes.com/woosidebars/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'WooSidebars Documentation', 'woosidebars' ) . '</a></p>'
|
| 765 |
);
|
| 766 |
} // End add_contextual_help()
|
| 767 |
|
readme.txt
CHANGED
|
@@ -2,8 +2,8 @@
|
|
| 2 |
Contributors: woothemes, mattyza
|
| 3 |
Tags: widgets, sidebars, widget-areas
|
| 4 |
Requires at least: 3.3
|
| 5 |
-
Tested up to: 3.5
|
| 6 |
-
Stable tag: 1.2.
|
| 7 |
License: GPLv2 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 9 |
|
|
@@ -60,6 +60,11 @@ For further documentation on using WooSidebars, please view the [WooSidebars Doc
|
|
| 60 |
|
| 61 |
Yes; WooSidebars will work with any theme that supports dynamic widget areas.
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
== Screenshots ==
|
| 64 |
|
| 65 |
1. The list of custom widget areas.
|
|
@@ -67,11 +72,20 @@ Yes; WooSidebars will work with any theme that supports dynamic widget areas.
|
|
| 67 |
|
| 68 |
== Upgrade Notice ==
|
| 69 |
|
|
|
|
|
|
|
|
|
|
| 70 |
= 1.2.0 =
|
| 71 |
Moved to WordPress.org. Woo! Added scope to methods and properties where missing.
|
| 72 |
|
| 73 |
== Changelog ==
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
= 1.2.0 =
|
| 76 |
* Renamed files according to standards naming convention.
|
| 77 |
* Added scope to methods and properties where missing.
|
| 2 |
Contributors: woothemes, mattyza
|
| 3 |
Tags: widgets, sidebars, widget-areas
|
| 4 |
Requires at least: 3.3
|
| 5 |
+
Tested up to: 3.5
|
| 6 |
+
Stable tag: 1.2.1
|
| 7 |
License: GPLv2 or later
|
| 8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 9 |
|
| 60 |
|
| 61 |
Yes; WooSidebars will work with any theme that supports dynamic widget areas.
|
| 62 |
|
| 63 |
+
= How can I contribute to WooSidebars development? =
|
| 64 |
+
|
| 65 |
+
Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/woosidebars/).
|
| 66 |
+
(submit pull requests to the "develop" branch)
|
| 67 |
+
|
| 68 |
== Screenshots ==
|
| 69 |
|
| 70 |
1. The list of custom widget areas.
|
| 72 |
|
| 73 |
== Upgrade Notice ==
|
| 74 |
|
| 75 |
+
= 1.2.1 =
|
| 76 |
+
Updated for WordPress 3.5+ compatibility. Adjusted "Advanced" tab logic. Fixed bug where "Template Hierarchy -> Pages" condition wasn't being applied correctly. Dequeue WordPress SEO admin stylesheets from the "Widget Areas" "Add" and "Edit" screens.
|
| 77 |
+
|
| 78 |
= 1.2.0 =
|
| 79 |
Moved to WordPress.org. Woo! Added scope to methods and properties where missing.
|
| 80 |
|
| 81 |
== Changelog ==
|
| 82 |
|
| 83 |
+
= 1.2.1 =
|
| 84 |
+
* 2013-01-09
|
| 85 |
+
* Updated admin JavaScript for WordPress 3.5+ compatibility. Moved "Advanced" tab outside of the tabs list.
|
| 86 |
+
* Fixed bug with the "Template Hierarchy -> Pages" condition that wasn't applying.
|
| 87 |
+
* When WordPress SEO is active, dequeue unused stylesheets on the "Widget Areas" "add" and "edit" screens.
|
| 88 |
+
|
| 89 |
= 1.2.0 =
|
| 90 |
* Renamed files according to standards naming convention.
|
| 91 |
* Added scope to methods and properties where missing.
|
woosidebars.php
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
* Description: Replace widget areas in your theme for specific pages, archives and other sections of WordPress.
|
| 6 |
* Author: WooThemes
|
| 7 |
* Author URI: http://woothemes.com/
|
| 8 |
-
* Version: 1.2.
|
| 9 |
-
* Stable tag: 1.2.
|
| 10 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
| 11 |
*/
|
| 12 |
|
|
@@ -22,6 +22,6 @@
|
|
| 22 |
|
| 23 |
global $woosidebars;
|
| 24 |
$woosidebars = new Woo_Sidebars( __FILE__ );
|
| 25 |
-
$woosidebars->version = '1.2.
|
| 26 |
$woosidebars->init();
|
| 27 |
?>
|
| 5 |
* Description: Replace widget areas in your theme for specific pages, archives and other sections of WordPress.
|
| 6 |
* Author: WooThemes
|
| 7 |
* Author URI: http://woothemes.com/
|
| 8 |
+
* Version: 1.2.1
|
| 9 |
+
* Stable tag: 1.2.1
|
| 10 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
| 11 |
*/
|
| 12 |
|
| 22 |
|
| 23 |
global $woosidebars;
|
| 24 |
$woosidebars = new Woo_Sidebars( __FILE__ );
|
| 25 |
+
$woosidebars->version = '1.2.1';
|
| 26 |
$woosidebars->init();
|
| 27 |
?>
|
