Ticket #11823: taxonomy.php.2.diff
File taxonomy.php.2.diff, 1.9 KB (added by , 14 years ago) |
---|
-
taxonomy.php
old new 906 906 $exclude = ''; 907 907 $exclude_tree = ''; 908 908 $interms = wp_parse_id_list($include); 909 foreach ( $interms as $interm ) { 910 if ( empty($inclusions) ) 911 $inclusions = ' AND ( t.term_id = ' . intval($interm) . ' '; 912 else 913 $inclusions .= ' OR t.term_id = ' . intval($interm) . ' '; 914 } 909 $interms = array_map( 'intval', $interms ); 910 $inclusions = implode( ',', $interms ); 915 911 } 916 912 917 913 if ( !empty($inclusions) ) 918 $inclusions .= ')';914 $inclusions = ' AND t.term_id IN ( ' . $inclusions . ' )'; 919 915 $where .= $inclusions; 920 916 921 917 $exclusions = ''; … … 924 920 foreach ( $excluded_trunks as $extrunk ) { 925 921 $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids')); 926 922 $excluded_children[] = $extrunk; 927 foreach( $excluded_children as $exterm ) { 928 if ( empty($exclusions) ) 929 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 930 else 931 $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' '; 932 } 923 $excluded_children = array_map( 'intval', $excluded_children ); 924 $exclusions = implode( ',', $excluded_children ); 933 925 } 934 926 } 935 927 936 928 if ( !empty($exclude) ) { 937 929 $exterms = wp_parse_id_list($exclude); 938 foreach ( $exterms as $exterm ) { 939 if ( empty($exclusions) ) 940 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 941 else 942 $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' '; 943 } 930 $exterms = array_map( 'intval', $exterms ); 931 if ( empty( $exclusions ) ) 932 $exclusions = implode( ',', $exterms ); 933 else 934 $exclusions .= ', ' . implode( ',', $exterms ); 944 935 } 945 936 946 937 if ( !empty($exclusions) ) 947 $exclusions .= ')';938 $exclusions = ' AND t.term_id NOT IN ( ' . $exclusions . ' )'; 948 939 $exclusions = apply_filters('list_terms_exclusions', $exclusions, $args ); 949 940 $where .= $exclusions; 950 941