WordPress.org

Plugin Directory

Changeset 542943


Ignore:
Timestamp:
05/11/12 16:15:54 (2 years ago)
Author:
Omicron7
Message:

Version 1.1.1 release

Location:
advanced-custom-fields-taxonomy-field-add-on/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-taxonomy-field-add-on/trunk/readme.txt

    r525455 r542943  
    33Tags: acf, acf add-on, taxonomy, custom field, taxonomy field 
    44Requires at least: 3.0 
    5 Tested up to: 3.3.1 
    6 Stable tag: 1.1 
     5Tested up to: 3.3.2 
     6Stable tag: 1.1.1 
    77 
    88Adds a Taxonomy Field to Advanced Custom Fields. Select one or more taxonomy terms and assign them to the post. 
     
    5757== Changelog == 
    5858 
     59= 1.1.1 = 
     60* Fixed issue with path and URI generation on Windows hosts. 
     61* Fixed missing and invalid argument notices for get_field() api call. Thanks Rahe for the patch. 
     62 
    5963= 1.1 = 
    6064* Improved get_value API call. Using `get_value()` now returns a string of term links. Similar to WordPress `get_the_term_list()`. 
  • advanced-custom-fields-taxonomy-field-add-on/trunk/taxonomy-field.php

    r525455 r542943  
    66* Author:      Brian Zoetewey 
    77* Author URI:  https://github.com/GCX 
    8 * Version:     1.1 
     8* Version:     1.1.1 
    99* Text Domain: acf-taxonomy-field 
    1010* Domain Path: /languages/ 
     
    4949 *  
    5050 * @author Brian Zoetewey <brian.zoetewey@ccci.org> 
    51  * @version 1.0 
     51 * @version 1.1.1 
    5252 */ 
    5353class ACF_Taxonomy_Field extends acf_Field { 
     
    9292         
    9393        //Base directory of this field 
    94         $this->base_dir = rtrim( dirname( realpath( __FILE__ ) ), '/' ); 
     94        $this->base_dir = rtrim( dirname( realpath( __FILE__ ) ), DIRECTORY_SEPARATOR ); 
    9595         
    9696        //Build the base relative uri by searching backwards until we encounter the wordpress ABSPATH 
    97         $root = array_pop( explode( '/', rtrim( ABSPATH, '/' ) ) ); 
    98         $path_parts = explode( '/', $this->base_dir ); 
     97        //This may not work if the $base_dir contains a symlink outside of the WordPress ABSPATH 
     98        $root = array_pop( explode( DIRECTORY_SEPARATOR, rtrim( realpath( ABSPATH ), DIRECTORY_SEPARATOR ) ) ); 
     99        $path_parts = explode( DIRECTORY_SEPARATOR, $this->base_dir ); 
    99100        $parts = array(); 
    100101        while( $part = array_pop( $path_parts ) ) { 
     
    348349        foreach( $value as $term_id ) { 
    349350            $term_id = intval( $term_id ); 
    350             $term = get_term( $term_id ); 
    351             $link = get_term_link( $term, $taxonomy ); 
     351            $term = get_term( $term_id, $field[ 'taxonomy' ] ); 
     352            $link = get_term_link( $term, $field[ 'taxonomy' ] ); 
    352353            if( !is_wp_error( $link ) ) 
    353354                $term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>'; 
Note: See TracChangeset for help on using the changeset viewer.