Plugin Directory

Changeset 1774316


Ignore:
Timestamp:
11/23/2017 07:57:15 PM (8 years ago)
Author:
dunar21
Message:

All categories were displaying when only one was expected.

Location:
wp-moo-tree/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-moo-tree/trunk/README.txt

    r620906 r1774316  
    77Tags: genealogy, file tree, family tree, tree, hierarchy, hierarchy tree, files, family, families, folders, folder list, file list, list, family list,
    88Requires at least: 3.0.1
    9 Tested up to: 3.4
    10 Stable tag: 1.0.5
     9Tested up to: 4.9
     10Stable tag: 1.1.0
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969
    7070== Changelog ==
     71= 1.1.0 =
     72* Bug fix; Multiple categories were displayed when only one expected.
    7173= 1.0.5 =
    7274* minor bug fix; when creating new category, fields would not save, had to be edited after creation.
  • wp-moo-tree/trunk/tree-shortcode.php

    r600840 r1774316  
    9292                        'title_li'     => '',
    9393                        'echo'         => 0,
     94                        //'child_of'       => $taxonomy_term->term_id,
    9495                        'sort_column'  => 'post_date',
    9596                        'post_type'    => 'mootree',
    9697                        'post_status'  => 'publish',
    9798                        'walker'       => $mootree_walker,
     99                        'link_before'  => $taxonomy_term->term_id,
    98100                        'link_after'    => 'mootree'
    99101                        );
     
    102104                    $piecesof .= '</ul>';
    103105                    $piecesof .= '<div style="clear:both;padding-top:20px"></div>';
    104                     return $piecesof;
     106                    return $piecesof . "<br/><br/><br/><pre>" . $thelist . "</pre>";
    105107}//funct
    106108
     
    141143       
    142144        if($link_after == 'mootree'){
    143        
     145                $termID = (int)$link_before;
     146                $term_list = wp_get_post_terms($page->ID, 'tree-categories', array("fields" => "ids"));
    144147                if(has_post_thumbnail($page->ID)) {
    145148                    $printlink = wp_get_attachment_url( get_post_thumbnail_id($page->ID) );
     
    175178                if ($thdescript && $thdescript != ""){$commentatts .= 'description: ' . $thdescript . ';';}
    176179               
    177                 $output .= $indent . '<li class="' . $page->post_name . '" ><a href="' . $printlink . '" name="' . $page->post_name . '" title="" ><!-- ' . $commentatts . ' -->' . apply_filters( 'the_title', $page->post_title, $page->ID ) . '</a>';
     180                if(in_array($termID, $term_list)){
     181                    $output .= $indent . '<li class="' . $page->post_name . '" ><a href="' . $printlink . '" name="' . $page->post_name . '" title="" ><!-- ' . $commentatts . ' -->' . apply_filters( 'the_title', $page->post_title, $page->ID ) . '</a>';
     182                }
    178183                   
    179184                                   
     
    195200    }
    196201   
     202    function end_el(&$output, $page, $depth = 0, $args = array()){
     203        $partOfCateg = false;
     204        if($link_after == 'mootree'){
     205            $termID = (int)$link_before;
     206            $term_list = wp_get_post_terms($page->ID, 'tree-categories', array("fields" => "ids"));
     207            if(in_array($termID, $term_list)){
     208                if(isset( $args['item_spacing']) && 'preserve' === $args['item_spacing']){
     209                    $t = "\t";
     210                    $n = "\n";
     211                }else{
     212                    $t = '';
     213                    $n = '';
     214                }
     215                $output .= "</li>{$n}";
     216            }
     217        }else{     
     218            if(isset( $args['item_spacing']) && 'preserve' === $args['item_spacing']){
     219                $t = "\t";
     220                $n = "\n";
     221            }else{
     222                $t = '';
     223                $n = '';
     224            }
     225            $output .= "</li>{$n}";
     226        }
     227    }
     228   
    197229}
    198230?>
  • wp-moo-tree/trunk/wp-moo-tree.php

    r620906 r1774316  
    44 *Plugin URI: http://aryanduntley.com/wordpressplugins/mootree
    55 *Description: Generates file, geneology, etc., trees via custom post types.
    6  *Version: 1.0.5
     6 *Version: 1.1.0
    77 *Author: Aryan Duntley
    88 *Author URI: http://aryanduntley.com/
Note: See TracChangeset for help on using the changeset viewer.