WordPress.org

Plugin Directory

Changeset 433300


Ignore:
Timestamp:
09/04/11 17:47:04 (3 years ago)
Author:
tollmanz
Message:

Fixed issue with "get_the_term_list"

Location:
custom-taxonomy-sort/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • custom-taxonomy-sort/trunk/custom-taxonomy-sort.php

    r413549 r433300  
    55Description: Custom Taxonomy Sort allows you to explicitly control the sort order of all taxonomy terms. 
    66Author: Zack Tollman 
    7 Author URI: http://www.zackdev.com 
    8 Version: 1.1.2 
     7Author URI: https://twitter.com/#!/zack_dev 
     8Version: 1.1.3 
    99 
    1010Plugin: Copyright 2011 Zack Tollman (email: zack [at] zackdev [dot] com) 
     
    100100        // Apply the filter that changes the sort order 
    101101        add_filter('wp_get_object_terms', array(&$this, 'wp_get_object_terms'), 10, 4); 
     102 
     103        // Apply filter for the get_the_terms 
     104        add_filter('get_the_terms', array(&$this, 'get_the_terms'), 10, 3); 
    102105         
    103106        // Apply the filter to catch the custom sort 
     
    361364     * @param mixed $taxonomies 
    362365     * @param mixed $args 
    363      * @return void 
     366     * @return array Array of sorted object terms 
    364367     */ 
    365368    function wp_get_object_terms($terms, $object_ids, $taxonomies, $args) 
     
    369372        return $this->get_terms($terms, $taxonomies, $args); 
    370373    } 
     374 
     375    /** 
     376     * Sorts terms in the context of "get_the_terms" 
     377     * 
     378     * @param $terms array Object terms 
     379     * @param $id string ID of post 
     380     * @param $taxonomy string Taxonomy of terms 
     381     * @return array Array of sorted object terms 
     382     */ 
     383    function get_the_terms($terms, $id, $taxonomy) 
     384    { 
     385        return $this->get_terms($terms, $taxonomy, $this->orderby_parameter); 
     386    } 
    371387 
    372388    /** 
  • custom-taxonomy-sort/trunk/readme.txt

    r413557 r433300  
    55Requires at least: 3.1 
    66Tested up to: 3.2.1 
    7 Stable tag: 1.1.2 
     7Stable tag: 1.1.3 
    88 
    99Custom Taxonomy Sort allows you to explicitly control the sort order of all taxonomy terms. 
     
    6666== Changelog == 
    6767 
     68= 1.1.3 = 
     69* Fixed a potential situation where the custom sort does not work with "get_the_term_list". Thanks to [@anointed](http://wordpress.org/support/topic/plugin-custom-taxonomy-sort-get_the_term_list-not-using-sort?replies=4) 
     70 
    6871= 1.1.2 = 
    6972* Works for more custom taxonomies in more situations 
     
    8891== Upgrade Notice == 
    8992 
     93= 1.1.3 = 
     94Fixed issue where sort may not be applied in certain situations 
     95 
    9096= 1.1.2 = 
    9197Works for more taxonomies 
Note: See TracChangeset for help on using the changeset viewer.