Plugin Directory

Changeset 350763


Ignore:
Timestamp:
02/25/2011 02:09:35 AM (15 years ago)
Author:
echoz
Message:

allow compatibility with < 3.1

Location:
elevate-parent-category-template/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • elevate-parent-category-template/trunk/elevate-parent-category-template.php

    r350756 r350763  
    33Plugin Name: Elevate Parent Category Template
    44Description: Elevates parent category template to top of Wordpress Loop.
    5 Version: 1.0
     5Version: 1.0.3
    66Author: Jeremy Foo
    77Author URI: http://thirdly.org/
     
    8686            // fix from marty@halfempty to deal with custom template.
    8787            if (!file_exists(STYLESHEETPATH . '/category-' . $category->slug . '.php')) {
    88                 //fix for WP 3.1
    89                 $parent = get_category($parent);
    90                 $wp_query->queried_object->slug = $parent->slug;
     88                if (version_compare($wp_version, '3.1', '>=')) {
     89                    //fix for WP 3.1
     90                    $parent = get_category($parent);
     91                    $wp_query->queried_object->slug = $parent->slug;
     92                   
     93                } else {
     94                    $wp_query->query_vars['cat'] = $parent;
     95                   
     96                }
     97               
    9198            }
    9299        }
  • elevate-parent-category-template/trunk/readme.txt

    r350756 r350763  
    55Tested up to: 3.1
    66Requires at least: 2.5
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88
    99Elevates parent category template to top of WordPress Loop.
Note: See TracChangeset for help on using the changeset viewer.