Ticket #4147: tax_link_cat.diff
| File tax_link_cat.diff, 2.3 KB (added by , 19 years ago) |
|---|
-
wp-includes/category.php
2 2 3 3 define('TAXONOMY_CATEGORY', 1); 4 4 define('TAXONOMY_TAG', 2); 5 define('TAXONOMY_LINK_CATEGORY', 4); 5 6 6 7 function get_all_category_ids() { 7 8 global $wpdb; … … 75 76 $exclusions = apply_filters('list_cats_exclusions', $exclusions, $r ); 76 77 $where .= $exclusions; 77 78 79 if ( 'link' == $type ) 80 $where .= ' AND ( type & ' . TAXONOMY_LINK_CATEGORY . ' != 0 ) '; 81 else 82 $where .= ' AND ( type & ' . TAXONOMY_CATEGORY . ' != 0 ) '; 83 78 84 if ( $hide_empty && !$hierarchical ) { 79 85 if ( 'link' == $type ) 80 86 $where .= ' AND link_count > 0'; 81 87 else 82 88 $where .= ' AND category_count > 0'; 83 } else {84 $where .= ' AND ( type & ' . TAXONOMY_CATEGORY . ' != 0 ) ';85 89 } 86 87 90 88 91 89 92 if ( !empty($number) ) -
wp-admin/upgrade-functions.php
182 182 if ( $wp_current_db_version < 4772 ) 183 183 upgrade_210(); 184 184 185 if ( $wp_current_db_version < 5267 ) 186 upgrade_220(); 187 185 188 if ( $wp_current_db_version < 4351 ) 186 189 upgrade_old_slugs(); 187 190 … … 565 568 } 566 569 } 567 570 571 function upgrade_220() { 572 global $wpdb, $wp_current_db_version; 573 574 // Set category type 575 if ( $wp_current_db_version < 5267 ) { 576 $wpdb->query("UPDATE $wpdb->categories SET type = type | " . TAXONOMY_CATEGORY . " WHERE category_count > 0"); 577 $wpdb->query("UPDATE $wpdb->categories SET type = type | " . TAXONOMY_LINK_CATEGORY . " WHERE link_count > 0"); 578 } 579 } 580 568 581 function upgrade_old_slugs() { 569 582 // upgrade people who were using the Redirect Old Slugs plugin 570 583 global $wpdb; -
wp-admin/upgrade-schema.php
21 21 tag_count bigint(20) NOT NULL default '0', 22 22 posts_private tinyint(1) NOT NULL default '0', 23 23 links_private tinyint(1) NOT NULL default '0', 24 type tinyint NOT NULL default ' 1',24 type tinyint NOT NULL default '0', 25 25 PRIMARY KEY (cat_ID), 26 26 KEY category_nicename (category_nicename) 27 27 ) $charset_collate;