Changeset 1894533
- Timestamp:
- 06/18/2018 11:59:17 AM (8 years ago)
- Location:
- woosidebars
- Files:
-
- 23 added
- 6 edited
-
tags/1.4.4 (added)
-
tags/1.4.4/CONTRIBUTING.md (added)
-
tags/1.4.4/assets (added)
-
tags/1.4.4/assets/css (added)
-
tags/1.4.4/assets/css/admin-posts.css (added)
-
tags/1.4.4/assets/css/admin.css (added)
-
tags/1.4.4/assets/images (added)
-
tags/1.4.4/assets/images/icon-settings.png (added)
-
tags/1.4.4/assets/images/success-off.png (added)
-
tags/1.4.4/assets/images/success.png (added)
-
tags/1.4.4/assets/js (added)
-
tags/1.4.4/assets/js/admin.js (added)
-
tags/1.4.4/changelog.txt (added)
-
tags/1.4.4/classes (added)
-
tags/1.4.4/classes/class-woo-conditions.php (added)
-
tags/1.4.4/classes/class-woo-sidebars.php (added)
-
tags/1.4.4/index.php (added)
-
tags/1.4.4/integrations (added)
-
tags/1.4.4/integrations/integration-woocommerce.php (added)
-
tags/1.4.4/lang (added)
-
tags/1.4.4/lang/woosidebars.pot (added)
-
tags/1.4.4/readme.txt (added)
-
tags/1.4.4/woosidebars.php (added)
-
trunk/CONTRIBUTING.md (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/classes/class-woo-conditions.php (modified) (9 diffs)
-
trunk/classes/class-woo-sidebars.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/woosidebars.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woosidebars/trunk/CONTRIBUTING.md
r755213 r1894533 7 7 __Note:__ 8 8 9 GitHub is for *bug reports and contributions only* - if you have a support question or a request for a customization, don't post here. Use [Wo oThemes Support](http://support.woothemes.com) for customer support, [WordPress.org](http://wordpress.org/support/plugin/woosidebars) for community support, and for customisations we recommend one of the following services:9 GitHub is for *bug reports and contributions only* - if you have a support question or a request for a customization, don't post here. Use [WordPress.org](http://wordpress.org/support/plugin/woosidebars) for community support, and for customisations we recommend one of the following services: 10 10 11 11 - Codeable: http://codeable.io/ 12 12 - Tweaky: https://www.tweaky.com/ 13 - Affiliated Woo Workers: http://www.woothemes.com/affiliated-woo-workers/13 - WooExperts: http://www.woocommerce.com/experts/ 14 14 15 15 ## Getting Started … … 36 36 * [General GitHub documentation](http://help.github.com/) 37 37 * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) 38 * [WooSidebars Docs](http://docs.woo themes.com/documentation/plugins/woosidebars/)39 * [Woo Themes Support](http://support.woothemes.com/)38 * [WooSidebars Docs](http://docs.woocommerce.com/documentation/plugins/woosidebars/) 39 * [WooCommerce Support](http://woocommerce.com/my-account/tickets/) -
woosidebars/trunk/changelog.txt
r1251099 r1894533 1 1 *** WooSidebars Changelog *** 2 3 2018.06.08 - version 1.4.4 4 * New - Enable a widget area for "a page and it's children". 5 * Fix - Error notice when on a page without a defined screen_id. 2 6 3 7 2015.09.22 - version 1.4.3 -
woosidebars/trunk/classes/class-woo-conditions.php
r1251099 r1894533 117 117 $post_statuses = get_post_statuses(); 118 118 119 // Pages 119 // Pages and Pages with children 120 120 $conditions['pages'] = array(); 121 $conditions['pages_with_children'] = array(); 121 122 122 123 $statuses_string = join( ',', array_keys( $post_statuses ) ); … … 126 127 127 128 $conditions_headings['pages'] = __( 'Pages', 'woosidebars' ); 129 $conditions_headings['pages_with_children'] = __( 'Pages and their children', 'woosidebars' ); 128 130 129 131 foreach ( $pages as $k => $v ) { 130 132 $token = 'post-' . $v->ID; 133 $pwctoken = 'postwc-' . $v->ID; 134 131 135 $label = esc_html( $v->post_title ); 132 136 if ( 'publish' != $v->post_status ) { … … 135 139 136 140 $conditions['pages'][$token] = array( 137 'label' => $label, 138 'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title ) 139 ); 140 } 141 141 'label' => $label, 142 'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title ) 143 ); 144 145 $conditions['pages_with_children'][$pwctoken] = array( 146 'label' => $label, 147 'description' => sprintf( __( 'The "%s" page and its children', 'woosidebars' ), $v->post_title ), 148 'parent' => $v->post_parent, 149 'ID' => $v->ID, 150 ); 151 } 152 153 $conditions['pages_with_children'] = $this->add_depth( $conditions['pages_with_children'] ); 142 154 } 143 155 … … 275 287 // Setup each individual taxonomy's terms as well. 276 288 $conditions_headings['taxonomy-' . $k] = $taxonomy->labels->name; 277 $terms = get_terms( $k);289 $terms = get_terms( array( 'taxonomy' => $k, 'hide_empty' => false ) ); 278 290 if ( count( $terms ) > 0 ) { 279 291 $conditions['taxonomy-' . $k] = array(); … … 341 353 ); 342 354 355 343 356 $this->conditions_reference = (array)apply_filters( 'woo_conditions_reference', $conditions ); 344 357 $this->conditions_headings = (array)apply_filters( 'woo_conditions_headings', $conditions_headings ); 345 358 } // End setup_default_conditions_reference() 346 359 360 361 private function add_depth( $conditions ) { 362 $map = array(); 363 $depth = array(); 364 foreach ( $conditions as $condition ) { 365 $map[ $condition['ID'] ] = $condition['parent']; 366 } 367 368 foreach ( $map as $id => $parent ) { 369 $d = 0; 370 while ( 0 != $parent ) { 371 $d++; 372 $parent = $map[$parent]; 373 } 374 $depth[$id] = $d; 375 } 376 377 foreach ( $conditions as $key => $condition ) { 378 $conditions[ $key ]['depth'] = $depth[ $condition['ID'] ]; 379 } 380 381 return $conditions; 382 } 383 347 384 /** 348 385 * is_hierarchy function. 349 386 * 350 * @description Is the current view a part of the default template h eirarchy?387 * @description Is the current view a part of the default template hierarchy? 351 388 * @access public 352 389 * @return void … … 401 438 // Post-specific condition. 402 439 $this->conditions[] = 'post' . '-' . get_the_ID(); 440 $this->conditions[] = 'postwc' . '-' . get_the_ID(); 441 } 442 443 $ancestors = get_post_ancestors( get_the_ID() ); 444 445 foreach ( $ancestors as $ancestor ) { 446 $this->conditions[] = 'postwc-' . $ancestor; 403 447 } 404 448 405 449 if ( is_search() ) { 406 450 $this->conditions[] = 'search'; 407 }408 409 if ( is_home() ) {410 $this->conditions[] = 'home';411 }412 413 if ( is_front_page() ) {414 $this->conditions[] = 'front_page';415 451 } 416 452 … … 524 560 if ( count( $this->conditions_reference ) > 0 ) { 525 561 526 // Separate out the taxonomy items for use as sub-tabs of "Taxonomy Terms".562 // Separate out the taxonomy items and pages with children for use as sub-tabs of "Taxonomy Terms" and hierarchical presentation of pages 527 563 $taxonomy_terms = array(); 564 $pwc = array(); 565 528 566 529 567 foreach ( $this->conditions_reference as $k => $v ) { … … 532 570 unset( $this->conditions_reference[$k] ); 533 571 } 572 573 if ( 'pages_with_children' === $k ) { 574 $pwc[$k] = $v; 575 // unset( $this->conditions_reference[$k] ); 576 } 534 577 } 535 578 536 579 $html .= '<div id="taxonomy-category" class="categorydiv tabs woo-conditions">' . "\n"; 537 580 538 $html .= '<ul id="category-tabs" class="conditions-tabs alignleft">' . "\n"; 539 540 $count = 0; 541 542 // Determine whether or not to show advanced items, based on user's preference (default: false). 543 $show_advanced = $this->show_advanced_items(); 544 545 foreach ( $this->conditions_reference as $k => $v ) { 546 $count++; 547 $class = ''; 548 if ( $count == 1 ) { 549 $class = 'tabs'; 550 } else { 551 $class = 'hide-if-no-js'; 552 } 553 if ( in_array( $k, array( 'pages' ) ) ) { 554 $class .= ' basic'; 555 } else { 556 $class .= ' advanced'; 557 if ( ! $show_advanced ) { $class .= ' hide'; } 558 } 559 560 if ( isset( $this->conditions_headings[$k] ) ) { 561 $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-' . esc_attr( $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a></li>' . "\n"; 562 } 563 564 if ( $k == 'taxonomies' ) { 565 $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-taxonomy-terms">' . __( 'Taxonomy Terms', 'woosidebars' ) . '</a></li>' . "\n"; 566 } 567 } 568 569 $class = 'hide-if-no-js advanced'; 570 if ( ! $show_advanced ) { $class .= ' hide'; } 571 572 $html .= '</ul>' . "\n"; 573 574 $html .= '<ul class="conditions-tabs"><li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li></ul>' . "\n"; 575 576 foreach ( $this->conditions_reference as $k => $v ) { 577 $count = 0; 578 579 $tab = ''; 580 581 $tab .= '<div id="tab-' . esc_attr( $k ) . '" class="condition-tab">' . "\n"; 582 if ( isset( $this->conditions_headings[$k] ) ) { 583 $tab .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n"; 584 } 585 $tab .= '<ul class="alignleft conditions-column">' . "\n"; 586 foreach ( $v as $i => $j ) { 587 $count++; 588 589 $checked = ''; 590 if ( in_array( $i, $selected_conditions ) ) { 591 $checked = ' checked="checked"'; 592 } 593 $tab .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . $i . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n"; 594 595 if ( $count % 10 == 0 && $count < ( count( $v ) ) ) { 596 $tab .= '</ul><ul class="alignleft conditions-column">'; 597 } 598 } 599 600 $tab .= '</ul>' . "\n"; 601 // Filter the contents of the current tab. 602 $tab = apply_filters( 'woo_conditions_tab_' . esc_attr( $k ), $tab ); 603 $html .= $tab; 604 $html .= '<div class="clear"></div>'; 605 $html .= '</div>' . "\n"; 606 } 607 608 // Taxonomy Terms Tab 609 $html .= '<div id="tab-taxonomy-terms" class="condition-tab inner-tabs">' . "\n"; 610 $html .= '<ul class="conditions-tabs-inner hide-if-no-js">' . "\n"; 611 612 foreach ( $taxonomy_terms as $k => $v ) { 613 if ( ! isset( $this->conditions_headings[$k] ) ) { unset( $taxonomy_terms[$k] ); } 614 } 615 616 $count = 0; 617 foreach ( $taxonomy_terms as $k => $v ) { 618 $count++; 619 $class = ''; 620 if ( $count == 1 ) { 621 $class = 'tabs'; 622 } else { 623 $class = 'hide-if-no-js'; 624 } 625 626 $html .= '<li><a href="#tab-' . $k . '" title="' . __( 'Taxonomy Token', 'woosidebars' ) . ': ' . str_replace( 'taxonomy-', '', $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a>'; 627 if ( $count != count( $taxonomy_terms ) ) { 628 $html .= ' |'; 629 } 630 $html .= '</li>' . "\n"; 631 } 632 633 $html .= '</ul>' . "\n"; 634 635 foreach ( $taxonomy_terms as $k => $v ) { 636 $count = 0; 637 638 $html .= '<div id="tab-' . $k . '" class="condition-tab">' . "\n"; 639 $html .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n"; 640 $html .= '<ul class="alignleft conditions-column">' . "\n"; 641 foreach ( $v as $i => $j ) { 642 $count++; 643 644 $checked = ''; 645 if ( in_array( $i, $selected_conditions ) ) { 646 $checked = ' checked="checked"'; 647 } 648 $html .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . esc_attr( $i ) . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n"; 649 650 if ( $count % 10 == 0 && $count < ( count( $v ) ) ) { 651 $html .= '</ul><ul class="alignleft conditions-column">'; 652 } 653 } 654 655 $html .= '</ul>' . "\n"; 656 $html .= '<div class="clear"></div>'; 657 $html .= '</div>' . "\n"; 658 } 581 $html .= $this->render_tabs( $selected_conditions ); 582 583 $html .= $this->render_standard_pages( $selected_conditions ); 584 585 $html .= $this->render_taxonomy_terms_tabs( $taxonomy_terms, $selected_conditions ); 586 659 587 $html .= '</div>' . "\n"; 660 588 } … … 667 595 echo $html; 668 596 } // End meta_box_content() 597 598 private function render_tabs( $selected_conditions ) { 599 $html = '<ul id="category-tabs" class="conditions-tabs alignleft">' . "\n"; 600 601 $count = 0; 602 603 // Determine whether or not to show advanced items, based on user's preference (default: false). 604 $show_advanced = $this->show_advanced_items(); 605 606 foreach ( $this->conditions_reference as $k => $v ) { 607 $count++; 608 $class = ''; 609 if ( $count == 1 ) { 610 $class = 'tabs'; 611 } else { 612 $class = 'hide-if-no-js'; 613 } 614 if ( in_array( $k, array( 'pages' ) ) ) { 615 $class .= ' basic'; 616 } else { 617 $class .= ' advanced'; 618 if ( ! $show_advanced ) { $class .= ' hide'; } 619 } 620 621 if ( isset( $this->conditions_headings[$k] ) ) { 622 $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-' . esc_attr( $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a></li>' . "\n"; 623 } 624 625 if ( $k == 'taxonomies' ) { 626 $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-taxonomy-terms">' . __( 'Taxonomy Terms', 'woosidebars' ) . '</a></li>' . "\n"; 627 } 628 } 629 630 $class = 'hide-if-no-js advanced'; 631 if ( ! $show_advanced ) { $class .= ' hide'; } 632 633 $html .= '</ul>' . "\n"; 634 635 $html .= '<ul class="conditions-tabs"><li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li></ul>' . "\n"; 636 637 return $html; 638 } 639 640 private function render_standard_pages( $selected_conditions ) { 641 $html = ''; 642 643 foreach ( $this->conditions_reference as $k => $v ) { 644 $count = 0; 645 646 $tab = ''; 647 648 $tab .= '<div id="tab-' . esc_attr( $k ) . '" class="condition-tab">' . "\n"; 649 if ( isset( $this->conditions_headings[$k] ) ) { 650 $tab .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n"; 651 } 652 $tab .= '<ul class="alignleft conditions-column">' . "\n"; 653 foreach ( $v as $i => $j ) { 654 $depth = ''; 655 if ( isset( $j['depth'] ) ) { 656 $depth = str_repeat( ' ', $j['depth'] * 3 ); 657 } 658 $count++; 659 660 $checked = ''; 661 if ( in_array( $i, $selected_conditions ) ) { 662 $checked = ' checked="checked"'; 663 } 664 $tab .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '">' . $depth . '<input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . $i . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n"; 665 666 if ( $count % 10 == 0 && $count < ( count( $v ) ) ) { 667 $tab .= '</ul><ul class="alignleft conditions-column">'; 668 } 669 } 670 671 $tab .= '</ul>' . "\n"; 672 // Filter the contents of the current tab. 673 $tab = apply_filters( 'woo_conditions_tab_' . esc_attr( $k ), $tab ); 674 $html .= $tab; 675 $html .= '<div class="clear"></div>'; 676 $html .= '</div>' . "\n"; 677 } 678 679 return $html; 680 } 681 682 private function render_taxonomy_terms_tabs( $taxonomy_terms, $selected_conditions ) { 683 // Taxonomy Terms Tab 684 $html = '<div id="tab-taxonomy-terms" class="condition-tab inner-tabs">' . "\n"; 685 $html .= '<ul class="conditions-tabs-inner hide-if-no-js">' . "\n"; 686 687 foreach ( $taxonomy_terms as $k => $v ) { 688 if ( ! isset( $this->conditions_headings[$k] ) ) { unset( $taxonomy_terms[$k] ); } 689 } 690 691 $count = 0; 692 foreach ( $taxonomy_terms as $k => $v ) { 693 $count++; 694 $class = ''; 695 if ( $count == 1 ) { 696 $class = 'tabs'; 697 } else { 698 $class = 'hide-if-no-js'; 699 } 700 701 $html .= '<li><a href="#tab-' . $k . '" title="' . __( 'Taxonomy Token', 'woosidebars' ) . ': ' . str_replace( 'taxonomy-', '', $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a>'; 702 if ( $count != count( $taxonomy_terms ) ) { 703 $html .= ' |'; 704 } 705 $html .= '</li>' . "\n"; 706 } 707 708 $html .= '</ul>' . "\n"; 709 710 foreach ( $taxonomy_terms as $k => $v ) { 711 $count = 0; 712 713 $html .= '<div id="tab-' . $k . '" class="condition-tab">' . "\n"; 714 $html .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n"; 715 $html .= '<ul class="alignleft conditions-column">' . "\n"; 716 717 foreach ( $v as $i => $j ) { 718 $count++; 719 720 $checked = ''; 721 if ( in_array( $i, $selected_conditions ) ) { 722 $checked = ' checked="checked"'; 723 } 724 $html .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . esc_attr( $i ) . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n"; 725 726 if ( $count % 10 == 0 && $count < ( count( $v ) ) ) { 727 $html .= '</ul><ul class="alignleft conditions-column">'; 728 } 729 } 730 731 $html .= '</ul>' . "\n"; 732 $html .= '<div class="clear"></div>'; 733 $html .= '</div>' . "\n"; 734 735 } 736 return $html; 737 } 669 738 670 739 /** -
woosidebars/trunk/classes/class-woo-sidebars.php
r1142184 r1894533 376 376 */ 377 377 public function description_meta_box ( $post ) { 378 ?>379 <label class="screen-reader-text" for="excerpt"><?php _e( 'Description', 'woosidebars' ); ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>380 <p><?php printf( __( 'Add an optional description, to be displayed when adding widgets to this widget area on the %sWidgets%s screen.', 'woosidebars' ), '<a href="' . esc_url( admin_url( 'widgets.php' ) ) . '">', '</a>' ); ?></p>381 <?php378 ?> 379 <label class="screen-reader-text" for="excerpt"><?php _e( 'Description', 'woosidebars' ); ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea> 380 <p><?php printf( __( 'Add an optional description, to be displayed when adding widgets to this widget area on the %sWidgets%s screen.', 'woosidebars' ), '<a href="' . esc_url( admin_url( 'widgets.php' ) ) . '">', '</a>' ); ?></p> 381 <?php 382 382 } // End description_meta_box() 383 383 … … 454 454 if ( count( $sidebars ) > 0 ) { 455 455 foreach ( $sidebars as $k => $v ) { 456 $sidebar_id = $v->post_name; 457 // $sidebar_id = $this->prefix . $v->ID; 458 register_sidebar( array( 'name' => $v->post_title, 'id' => $sidebar_id, 'description' => $v->post_excerpt ) ); 456 $args = apply_filters( 'woosidebars_sidebar_args', array( 457 'name' => $v->post_title, 458 'id' => $v->post_name, 459 'description' => $v->post_excerpt, 460 ), $v, $this ); 461 register_sidebar( $args ); 459 462 } 460 463 } … … 499 502 'post_type' => $this->token, 500 503 'posts_per_page' => intval( $this->upper_limit ), 501 'suppress_filters' => 'false'504 'suppress_filters' => true 502 505 ); 503 506 … … 522 525 if ( count( $sidebars ) > 0 ) { 523 526 foreach ( $sidebars as $k => $v ) { 527 528 if ( defined( 'ICL_LANGUAGE_CODE' ) ) { 529 // get the post language 530 $wpml_element = apply_filters( 'wpml_element_language_code', ICL_LANGUAGE_CODE, array( 'element_id' => intval( $v->ID ), 'element_type' => 'post_sidebar' ) ); 531 // check if the current language matches the language of the sidebar 532 if ( $wpml_element != ICL_LANGUAGE_CODE ) { 533 continue; 534 } 535 } 536 524 537 $to_replace = get_post_meta( $v->ID, '_sidebar_to_replace', true ); 525 538 $sidebars[$k]->to_replace = $to_replace; … … 741 754 */ 742 755 public function add_contextual_help () { 743 if ( get_current_screen()->id != 'edit-sidebar' ) { return; }756 if ( empty( get_current_screen() ) || get_current_screen()->id != 'edit-sidebar' ) { return; } 744 757 745 758 get_current_screen()->add_help_tab( array( -
woosidebars/trunk/readme.txt
r1522943 r1894533 1 1 === WooSidebars === 2 Contributors: woothemes, mattyza2 Contributors: woothemes, Automattic, mattyza 3 3 Tags: widgets, sidebars, widget-areas 4 4 Requires at least: 4.1 5 Tested up to: 4.6. 16 Stable tag: 1.4. 35 Tested up to: 4.6.5 6 Stable tag: 1.4.4 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 70 70 == Upgrade Notice == 71 71 72 = 1.4.4 = 73 Bug fix and maintenance release. Enables "pages and their children" as a widget area condition. 74 72 75 = 1.4.3 = 73 76 Bug fix and maintenance release. … … 99 102 100 103 == Changelog == 104 105 = 1.4.4 = 106 * 2018-06-08 107 * Bug fix and maintenance release. Enables "pages and their children" as a widget area condition. 101 108 102 109 = 1.4.3 = -
woosidebars/trunk/woosidebars.php
r1522943 r1894533 2 2 /** 3 3 * Plugin Name: WooSidebars 4 * Plugin URI: http://woo themes.com/woosidebars/4 * Plugin URI: http://woocommerce.com/woosidebars/ 5 5 * Description: Replace widget areas in your theme for specific pages, archives and other sections of WordPress. 6 * Author: Woo Themes7 * Author URI: http://woo themes.com/8 * Version: 1.4. 39 * Stable tag: 1.4. 36 * Author: WooCommerce 7 * Author URI: http://woocommerce.com/ 8 * Version: 1.4.4 9 * Stable tag: 1.4.4 10 10 * Requires at least: 4.1 11 * Tested up to: 4.6. 111 * Tested up to: 4.6.5 12 12 * License: GPL v3 or later - http://www.gnu.org/licenses/gpl-3.0.html 13 13 * Text Domain: woosidebars … … 15 15 */ 16 16 17 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 17 if ( ! defined( 'ABSPATH' ) ) { 18 exit; // Exit if accessed directly 19 } 18 20 19 if ( ! class_exists( 'Woo_Conditions' ) ) {20 require_once( 'classes/class-woo-conditions.php' );21 }22 require_once( 'classes/class-woo-sidebars.php' );21 if ( ! class_exists( 'Woo_Conditions' ) ) { 22 require_once( 'classes/class-woo-conditions.php' ); 23 } 24 require_once( 'classes/class-woo-sidebars.php' ); 23 25 24 // Third-party integrations. 25 if ( class_exists( 'Woocommerce' ) ) require_once( 'integrations/integration-woocommerce.php' ); 26 // Third-party integrations. 27 if ( class_exists( 'Woocommerce' ) ) { 28 require_once( 'integrations/integration-woocommerce.php' ); 29 } 26 30 27 global $woosidebars; 28 $woosidebars = new Woo_Sidebars( __FILE__ ); 29 $woosidebars->version = '1.4.3'; 30 $woosidebars->init(); 31 ?> 31 global $woosidebars; 32 $woosidebars = new Woo_Sidebars( __FILE__ ); 33 $woosidebars->version = '1.4.4'; 34 $woosidebars->init();
Note: See TracChangeset
for help on using the changeset viewer.