Ticket #18752: 18752.2.diff
File 18752.2.diff, 2.4 KB (added by , 14 years ago) |
---|
-
wp-includes/default-filters.php
196 196 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 197 197 add_filter( 'widget_text', 'shortcode_unautop' ); 198 198 add_filter( 'widget_text', 'do_shortcode' ); 199 add_filter( 'post_link_categories', '_sort_terms_by_id' ); 199 200 200 201 // Actions 201 202 add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); -
wp-includes/link-template.php
121 121 if ( strpos($permalink, '%category%') !== false ) { 122 122 $cats = get_the_category($post->ID); 123 123 if ( $cats ) { 124 usort($cats, '_usort_terms_by_ID'); // order by ID124 $cats = apply_filters( 'post_link_categories', $cats ); 125 125 $category = $cats[0]->slug; 126 126 if ( $parent = $cats[0]->parent ) 127 127 $category = get_category_parents($parent, false, '/', true) . $category; … … 1128 1128 } 1129 1129 1130 1130 $excluded_categories = array_map( 'intval', $excluded_categories ); 1131 1131 1132 1132 if ( ! empty( $cat_array ) ) { 1133 1133 $excluded_categories = array_diff($excluded_categories, $cat_array); 1134 1134 $posts_in_ex_cats_sql = ''; … … 1276 1276 $cat_array = array(); 1277 1277 if( ! is_array( $excluded_categories ) ) 1278 1278 $excluded_categories = explode( ',', $excluded_categories ); 1279 1279 1280 1280 if ( $in_same_cat || ! empty( $excluded_categories ) ) { 1281 1281 if ( $in_same_cat ) 1282 1282 $cat_array = wp_get_object_terms( $post->ID, 'category', array( 'fields' => 'ids' ) ); -
wp-includes/category-template.php
126 126 } 127 127 128 128 /** 129 * Sort terms by ID. 130 * 131 * Used with the post_link_categories filter. 132 * 133 * @since 3.3.0 134 * @access private 135 * 136 * @param array $terms 137 * 138 * @return array Sorted terms 139 */ 140 function _sort_terms_by_id ( $terms ) { 141 usort( $terms, '_usort_terms_by_ID' ); 142 return $terms; 143 } 144 145 /** 129 146 * Retrieve category name based on category ID. 130 147 * 131 148 * @since 0.71