diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index 6e1a238ea5..b2ebd384db 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -121,18 +121,11 @@ function wp_insert_category($catarr) { else $links_private = 0; - if ( empty($type) ) - $type = TAXONOMY_CATEGORY; - - // Let's check if we have this category already, if so just do an update - if ( !$update && $cat_ID = category_object_exists( $category_nicename ) ) - $update = true; - if (!$update) { - $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private, type) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private', '$type')"); + $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private')"); $cat_ID = (int) $wpdb->insert_id; } else { - $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private', type = '$type' WHERE cat_ID = '$cat_ID'"); + $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private' WHERE cat_ID = '$cat_ID'"); } if ( $category_nicename == '' ) { @@ -198,18 +191,15 @@ function wp_delete_category($cat_ID) { $parent = $category->category_parent; - // Delete the category if it is not also a tag. - if ( 0 == ($category->type & TAXONOMY_TAG) ) { - if ( !$wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'") ) - return 0; - } else { - $wpdb->query("UPDATE $wpdb->categories SET type = type & ~" . TAXONOMY_CATEGORY . " WHERE cat_ID = '$cat_ID'"); - } + // Delete the category + if ( !$wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'") ) + return 0; + // Update children to point to new parent $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$parent' WHERE category_parent = '$cat_ID'"); // Only set posts and links to the default category if they're not in another category already - $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID' AND rel_type = 'category'"); + $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'"); foreach ( (array) $posts as $post_id ) { $cats = wp_get_post_categories($post_id); if ( 1 == count($cats) ) @@ -235,18 +225,8 @@ function wp_delete_category($cat_ID) { } function wp_create_category($cat_name) { - if ( $id = category_exists($cat_name) ) - return $id; - $cat_array = array('cat_name' => $cat_name, 'type' => TAXONOMY_CATEGORY); - - if ( $id = category_object_exists($cat_name) ) { - $category = get_category($id); - $cat_array['type'] = $category->type | $cat_array['type']; - $cat_array['cat_ID'] = $id; - return wp_update_category($cat_array); - } else { - return wp_insert_category($cat_array); - } + $cat_array = compact('cat_name'); + return wp_insert_category($cat_array); } function wp_create_categories($categories, $post_id = '') { @@ -265,44 +245,12 @@ function wp_create_categories($categories, $post_id = '') { return $cat_ids; } -function category_object_exists($cat_name) { - global $wpdb; - if (!$category_nicename = sanitize_title($cat_name)) - return 0; - - return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); -} - function category_exists($cat_name) { global $wpdb; if (!$category_nicename = sanitize_title($cat_name)) return 0; - return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename' AND ( type & " . TAXONOMY_CATEGORY . " != 0 )"); -} - -function tag_exists($tag_name) { - global $wpdb; - if (! $tag_nicename = sanitize_title($tag_name)) - return 0; - - return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$tag_nicename' AND ( type & " . TAXONOMY_TAG . " != 0 )"); -} - -function wp_create_tag($tag_name) { - if ( $id = tag_exists($tag_name) ) - return $id; - $tag_array = array('cat_name' => $tag_name, 'type' => TAXONOMY_TAG); - - if ( $id = category_object_exists($tag_name) ) { - $category = get_category($id); - $tag_array['type'] = $category->type | $tag_array['type']; - $tag_array['cat_ID'] = $id; - $id = wp_update_category($tag_array); - return $id; - } else { - return wp_insert_category($tag_array); - } + return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); } function wp_delete_user($id, $reassign = 'novalue') { diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index be07a73c9d..e9604e8286 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -647,7 +647,7 @@ function checked( $checked, $current) { function return_categories_list( $parent = 0 ) { global $wpdb; - return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( type & " . TAXONOMY_CATEGORY . " != 0 ) AND ( link_count = 0 OR category_count != 0 ) ORDER BY category_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( link_count = 0 OR category_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY category_count DESC" ); } function sort_cats( $cat1, $cat2 ) { @@ -657,29 +657,6 @@ function sort_cats( $cat1, $cat2 ) { return strcasecmp( $cat1['cat_name'], $cat2['cat_name'] ); } -function get_tags_to_edit( $post_id ) { - global $wpdb; - - $post_id = (int) $post_id; - if ( !$post_id ) - return false; - - $tags = $wpdb->get_results( " - SELECT category_id, cat_name - FROM $wpdb->categories, $wpdb->post2cat - WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_id' AND rel_type = 'tag' - " ); - if ( !$tags ) - return false; - - foreach ( $tags as $tag ) - $tag_names[] = $tag->cat_name; - $tags_to_edit = join( ', ', $tag_names ); - $tags_to_edit = attribute_escape( $tags_to_edit ); - $tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit ); - return $tags_to_edit; -} - function get_nested_categories( $default = 0, $parent = 0 ) { global $post_ID, $link_id, $mode, $wpdb; @@ -687,7 +664,7 @@ function get_nested_categories( $default = 0, $parent = 0 ) { $checked_categories = $wpdb->get_col( " SELECT category_id FROM $wpdb->categories, $wpdb->post2cat - WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID' AND rel_type = 'category' + WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID' " ); if ( count( $checked_categories ) == 0 ) { @@ -744,7 +721,7 @@ function dropdown_categories( $default = 0 ) { function return_link_categories_list( $parent = 0 ) { global $wpdb; - return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( type & " . TAXONOMY_CATEGORY . " != 0 ) AND ( category_count = 0 OR link_count != 0 ) ORDER BY link_count DESC" ); + return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( category_count = 0 OR link_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY link_count DESC" ); } function get_nested_link_categories( $default = 0, $parent = 0 ) { diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 18249cb7d6..5e77e0fd65 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -118,15 +118,6 @@ cat_rows(); - -
-

- - -
-
- -
-

diff --git a/wp-admin/import/utw.php b/wp-admin/import/utw.php deleted file mode 100644 index 916f8868a9..0000000000 --- a/wp-admin/import/utw.php +++ /dev/null @@ -1,270 +0,0 @@ -'; - echo '

'.__('Import Ultimate Tag Warrior').'

'; - echo '

'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

'; - } - - function footer() { - echo ''; - } - - function greet() { - echo '
'; - echo '

'.__('Howdy! This imports tags from an existing Ultimate Tag Warrior 3 installation into this blog using the new WordPress native tagging structure.').'

'; - echo '

'.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'

'; - echo '

'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'

'; - echo '

'.__('Don’t be stupid - backup your database before proceeding!').'

'; - echo '
'; - echo '

'; - echo '
'; - echo '
'; - } - - - function dispatch () { - if ( empty( $_GET['step'] ) ) { - $step = 0; - } else { - $step = (int) $_GET['step']; - } - - // load the header - $this->header(); - - switch ( $step ) { - case 0 : - $this->greet(); - break; - case 1 : - $this->import_tags(); - break; - case 2 : - $this->import_posts(); - break; - case 3: - $this->import_t2p(); - break; - case 4: - $this->cleanup_import(); - break; - } - - // load the footer - $this->footer(); - } - - - function import_tags ( ) { - echo '
'; - echo '

'.__('Reading UTW Tags…').'

'; - - $tags = $this->get_utw_tags(); - - // if we didn't get any tags back, that's all there is folks! - if ( !is_array($tags) ) { - echo '

' . __('No Tags Found!') . '

'; - return false; - } - else { - - // if there's an existing entry, delete it - if ( get_option('utwimp_tags') ) { - delete_option('utwimp_tags'); - } - - add_option('utwimp_tags', $tags); - - - $count = count($tags); - - echo '

' . sprintf( __('Done! %s tags were read.'), $count ) . '

'; - echo '

' . __('The following tags were found:') . '

'; - - echo ''; - - echo '
'; - - echo '

' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '

'; - - - } - - echo '
'; - echo '

'; - echo '
'; - echo '
'; - } - - - function import_posts ( ) { - echo '
'; - echo '

'.__('Reading UTW Post Tags…').'

'; - - // read in all the UTW tag -> post settings - $posts = $this->get_utw_posts(); - - // if we didn't get any tags back, that's all there is folks! - if ( !is_array($posts) ) { - echo '

' . __('No posts were found to have tags!') . '

'; - return false; - } - else { - - // if there's an existing entry, delete it - if ( get_option('utwimp_posts') ) { - delete_option('utwimp_posts'); - } - - add_option('utwimp_posts', $posts); - - - $count = count($posts); - - echo '

' . sprintf( __('Done! %s tag to post relationships were read.'), $count ) . '

'; - - } - - echo '
'; - echo '

'; - echo '
'; - echo '
'; - - } - - - function import_t2p ( ) { - - echo '
'; - echo '

'.__('Adding Tags to Posts…').'

'; - - // run that funky magic! - $tags_added = $this->tag2post(); - - echo '

' . sprintf( __('Done! %s tags where added!'), $tags_added ) . '

'; - - echo '
'; - echo '

'; - echo '
'; - echo '
'; - - } - - - function get_utw_tags ( ) { - - global $wpdb; - - // read in all the tags from the UTW tags table: should be wp_tags - $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags"; - - $tags = $wpdb->get_results($tags_query); - - // rearrange these tags into something we can actually use - foreach ( $tags as $tag ) { - - $new_tags[$tag->tag_id] = $tag->tag; - - } - - return $new_tags; - - } - - function get_utw_posts ( ) { - - global $wpdb; - - // read in all the posts from the UTW post->tag table: should be wp_post2tag - $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag"; - - $posts = $wpdb->get_results($posts_query); - - return $posts; - - } - - - function tag2post ( ) { - - // get the tags and posts we imported in the last 2 steps - $tags = get_option('utwimp_tags'); - $posts = get_option('utwimp_posts'); - - // null out our results - $tags_added = 0; - - // loop through each post and add its tags to the db - foreach ( $posts as $this_post ) { - - $the_post = (int) $this_post->post_id; - $the_tag = (int) $this_post->tag_id; - - // what's the tag name for that id? - $the_tag = $tags[$the_tag]; - - // screw it, just try to add the tag - wp_add_post_tags($the_post, $the_tag); - - $tags_added++; - - } - - // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! - return $tags_added; - - - } - - - function cleanup_import ( ) { - - delete_option('utwimp_tags'); - delete_option('utwimp_posts'); - - $this->done(); - - } - - - function done ( ) { - - echo '
'; - echo '

'.__('Import Complete!').'

'; - - echo '

' . __('OK, so we lied about this being a 5-step program! You’re done!') . '

'; - - echo '

' . __('Now wasn’t that easy?') . '

'; - - echo '
'; - - } - - - function UTW_Import ( ) { - - // Nothing. - - } - -} - - -// create the import object -$utw_import = new UTW_Import(); - -// add it to the import page! -register_importer('utw', 'Ultimate Tag Warrior', __('Import Ultimate Tag Warrior tags into the new native tagging structure.'), array($utw_import, 'dispatch')); - -?> \ No newline at end of file diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php deleted file mode 100644 index 6df9f1cce8..0000000000 --- a/wp-admin/import/wp-cat2tag.php +++ /dev/null @@ -1,226 +0,0 @@ -'; - print '

' . __('Convert Categories to Tags') . '

'; - } - - function footer() { - print ''; - } - - function populate_all_categories() { - global $wpdb; - - $this->all_categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE (type & ~ " . TAXONOMY_TAG . ") != 0 AND category_count > 0 ORDER BY cat_name ASC"); - } - - function welcome() { - $this->populate_all_categories(); - - print '
'; - - if (count($this->all_categories) > 0) { - print '

' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '

'; - print '

' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '

'; - - $this->categories_form(); - } else { - print '

'.__('You have no categories to convert!').'

'; - } - - print '
'; - } - - function categories_form() { - print '
'; - print ''; - - print '

'; - print '
'; - } - - function _category_children($parent, $hier) { - print ''; - } - - function _category_exists($cat_id) { - global $wpdb; - - $cat_id = (int) $cat_id; - - $maybe_exists = $wpdb->get_results("SELECT cat_ID from $wpdb->categories WHERE cat_ID = '$cat_id'"); - - if (count($maybe_exists) > 0) { - return true; - } else { - return false; - } - } - - function convert_them() { - global $wpdb; - - if (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) { - print '
'; - print '

' . sprintf(__('Uh, oh. Something didn\'t work. Please try again.'), 'admin.php?import=wp-cat2tag') . '

'; - print '
'; - } - - $this->categories_to_convert = $_POST['cats_to_convert']; - $hier = _get_category_hierarchy(); - - print ''; - } - - function convert_all_confirm() { - print '
'; - - print '

' . __('Confirm') . '

'; - - print '

' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '

'; - - print '
'; - print '

    

'; - print '
'; - - print '
'; - } - - function convert_all() { - global $wpdb; - - $cats = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE (type & ~ " . TAXONOMY_TAG . ") != 0 AND category_count > 0"); - - $_POST['cats_to_convert'] = array(); - - foreach ($cats as $cat) { - $_POST['cats_to_convert'][] = $cat->cat_ID; - } - - $this->convert_them(); - } - - function init() { - echo ''; - - if (isset($_POST['maybe_convert_all_cats'])) { - $step = 3; - } elseif (isset($_POST['yes_convert_all_cats'])) { - $step = 4; - } elseif (isset($_POST['no_dont_do_it'])) { - die('no_dont_do_it'); - } else { - $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; - } - - $this->header(); - - if (!current_user_can('manage_categories')) { - print '
'; - print '

' . __('Cheatin’ uh?') . '

'; - print '
'; - } else { - switch ($step) { - case 1 : - $this->welcome(); - break; - - case 2 : - $this->convert_them(); - break; - - case 3 : - $this->convert_all_confirm(); - break; - - case 4 : - $this->convert_all(); - break; - } - } - - $this->footer(); - } - - function WP_Categories_to_Tags() { - // Do nothing. - } -} - -$wp_cat2tag_importer = new WP_Categories_to_Tags(); - -register_importer('wp-cat2tag', __('Categories to Tags Converter'), __('Convert existing categories to tags, selectively.'), array(&$wp_cat2tag_importer, 'init')); - -?> diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index f71e6058fd..8a68a4699c 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -73,18 +73,10 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']); $wp_rewrite->set_category_base($category_base); } - - if ( isset($_POST['tag_base']) ) { - $tag_base = $_POST['tag_base']; - if (! empty($tag_base) ) - $tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']); - $wp_rewrite->set_tag_base($tag_base); - } } $permalink_structure = get_option('permalink_structure'); $category_base = get_option('category_base'); -$tag_base = get_option( 'tag_base' ); if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) $writable = true; @@ -167,9 +159,6 @@ checked="checked"

: -

-

- :

diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php index c6ee94fba9..1174d3896d 100644 --- a/wp-admin/upgrade-schema.php +++ b/wp-admin/upgrade-schema.php @@ -18,10 +18,8 @@ $wp_queries="CREATE TABLE $wpdb->categories ( category_parent bigint(20) NOT NULL default '0', category_count bigint(20) NOT NULL default '0', link_count bigint(20) NOT NULL default '0', - tag_count bigint(20) NOT NULL default '0', posts_private tinyint(1) NOT NULL default '0', links_private tinyint(1) NOT NULL default '0', - type tinyint NOT NULL default '1', PRIMARY KEY (cat_ID), KEY category_nicename (category_nicename) ) $charset_collate; @@ -90,7 +88,6 @@ CREATE TABLE $wpdb->post2cat ( rel_id bigint(20) NOT NULL auto_increment, post_id bigint(20) NOT NULL default '0', category_id bigint(20) NOT NULL default '0', - rel_type varchar(64) NOT NULL default 'category', PRIMARY KEY (rel_id), KEY post_id (post_id,category_id) ) $charset_collate; @@ -243,9 +240,6 @@ function populate_options() { add_option('default_link_category', 2); add_option('show_on_front', 'posts'); - // 2.2 - add_option('tag_base'); - // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing'); foreach ($unusedoptions as $option) : diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index bf53e6ee1c..5fc8d5504b 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -538,7 +538,7 @@ input.disabled, textarea.disabled { border: none; } -#postdiv, #titlediv, #guiddiv, #tagdiv { +#postdiv, #titlediv, #guiddiv { margin: 0 8px 0 0; padding: 0; } @@ -558,7 +558,7 @@ input.disabled, textarea.disabled { line-height: 140%; } -#titlediv input, #guiddiv input, #tagdiv input { +#titlediv input, #guiddiv input { margin: 0; width: 100%; } diff --git a/wp-content/themes/classic/index.php b/wp-content/themes/classic/index.php index d849d24e2c..ce020402f3 100644 --- a/wp-content/themes/classic/index.php +++ b/wp-content/themes/classic/index.php @@ -8,7 +8,7 @@ get_header();

-
@
+
@
diff --git a/wp-content/themes/default/archive.php b/wp-content/themes/default/archive.php index 0167ea14d0..1d2b1de358 100644 --- a/wp-content/themes/default/archive.php +++ b/wp-content/themes/default/archive.php @@ -1,25 +1,29 @@
- + - - + +

Archive for the ‘’ Category

- -

Posts Tagged ‘

+

Archive for

- + +

Archive for

- + +

Archive for

+

Author Archive

- + +

Blog Archives

- + + - +
diff --git a/wp-content/themes/default/index.php b/wp-content/themes/default/index.php index 3c5ad06715..ffb0779e94 100644 --- a/wp-content/themes/default/index.php +++ b/wp-content/themes/default/index.php @@ -14,7 +14,7 @@
-

'); ?> Posted in |

+

Posted in |

diff --git a/wp-content/themes/default/search.php b/wp-content/themes/default/search.php index ac7ec8f29a..5bd1bc6fd6 100644 --- a/wp-content/themes/default/search.php +++ b/wp-content/themes/default/search.php @@ -18,7 +18,7 @@

-

'); ?> Posted in |

+

Posted in |

diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php index ce17785d98..967a0655da 100644 --- a/wp-content/themes/default/single.php +++ b/wp-content/themes/default/single.php @@ -16,7 +16,6 @@ Read the rest of this entry »

'); ?> '

Pages: ', 'after' => '

', 'next_or_number' => 'number')); ?> - Tags: ', ', ', '

'); ?>

diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index c78fa82e49..2b40e717ce 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -272,90 +272,6 @@ function wp_list_categories($args = '') { echo apply_filters('wp_list_categories', $output); } -function wp_tag_cloud( $args = '' ) { - $defaults = array( - 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, - 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', - 'exclude' => '', 'include' => '' - ); - $args = wp_parse_args( $args, $defaults ); - - $tags = get_tags( array_merge($args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags - - if ( empty($tags) ) - return; - - $return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args - echo apply_filters( 'wp_tag_cloud', $return, $args ); -} - -// $tags = prefetched tag array ( get_tags() ) -// $args['format'] = 'flat' => whitespace separated, 'list' => UL, 'array' => array() -// $args['orderby'] = 'name', 'count' -function wp_generate_tag_cloud( $tags, $args = '' ) { - global $wp_rewrite; - $defaults = array( - 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, - 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC' - ); - $args = wp_parse_args( $args, $defaults ); - extract($args); - - if ( !$tags ) - return; - $counts = $tag_links = array(); - foreach ( (array) $tags as $tag ) { - $counts[$tag->cat_name] = $tag->tag_count; - $tag_links[$tag->cat_name] = get_tag_link( $tag->cat_ID ); - } - - $min_count = min($counts); - $spread = max($counts) - $min_count; - if ( $spread <= 0 ) - $spread = 1; - $font_spread = $largest - $smallest; - if ( $font_spread <= 0 ) - $font_spread = 1; - $font_step = $font_spread / $spread; - - // SQL cannot save you; this is a second (potentially different) sort on a subset of data. - if ( 'name' == $orderby ) - uksort($counts, 'strnatcasecmp'); - else - asort($counts); - - if ( 'DESC' == $order ) - $counts = array_reverse( $tag_counts, true ); - - $a = array(); - - $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; - - foreach ( $counts as $tag => $count ) { - $tag_link = clean_url($tag_links[$tag]); - $tag = str_replace(' ', ' ', wp_specialchars( $tag )); - $a[] = "$tag"; - } - - switch ( $format ) : - case 'array' : - $return =& $a; - break; - case 'list' : - $return = "

\n"; - break; - default : - $return = join("\n", $a); - break; - endswitch; - - return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args ); -} - // // Helper functions // @@ -372,63 +288,4 @@ function walk_category_dropdown_tree() { return call_user_func_array(array(&$walker, 'walk'), $args); } -// -// Tags -// - -function get_tag_link( $tag_id ) { - global $wp_rewrite; - $catlink = $wp_rewrite->get_tag_permastruct(); - - $category = &get_category($tag_id); - $category_nicename = $category->category_nicename; - - if ( empty($catlink) ) { - $file = get_option('home') . '/'; - $catlink = $file . '?tag=' . $category_nicename; - } else { - - $catlink = str_replace('%tag%', $category_nicename, $catlink); - $catlink = get_option('home') . user_trailingslashit($catlink, 'category'); - } - return apply_filters('tag_link', $catlink, $tag_id); -} - -function get_the_tags( $id = 0 ) { - global $post; - - $id = (int) $id; - - if ( ! $id && ! in_the_loop() ) - return false; // in-the-loop function - - if ( !$id ) - $id = (int) $post->ID; - - $tags = wp_get_post_tags( $id ); - $tags = apply_filters( 'get_the_tags', $tags ); - if ( empty( $tags ) ) - return false; - return $tags; -} - -function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) { - $tags = get_the_tags(); - - if ( empty( $tags ) ) - return false; - - $tag_list = $before; - foreach ( $tags as $tag ) - $tag_links[] = '' . $tag->cat_name . ''; - - $tag_links = join( $sep, $tag_links ); - $tag_links = apply_filters( 'the_tags', $tag_links ); - $tag_list .= $tag_links; - - $tag_list .= $after; - - echo $tag_list; -} - ?> diff --git a/wp-includes/category.php b/wp-includes/category.php index b60fd238e7..85b9507f35 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -1,8 +1,5 @@ 0'; else $where .= ' AND category_count > 0'; - } else { - $where .= ' AND ( type & ' . TAXONOMY_CATEGORY . ' != 0 ) '; } - - if ( !empty($number) ) $number = 'LIMIT ' . $number; else @@ -213,15 +206,6 @@ function get_category_by_path($category_path, $full_match = true, $output = OBJE return NULL; } -function get_category_by_slug( $slug ) { - global $wpdb; - $slug = sanitize_title( $slug ); - if ( empty( $slug ) ) - return false; - $category = $wpdb->get_var( "SELECT * FROM $wpdb->categories WHERE category_nicename = '$slug' " ); - return get_category( $category ); -} - // Get the ID of a category from its name function get_cat_ID($cat_name='General') { global $wpdb; @@ -344,86 +328,4 @@ function _get_category_hierarchy() { return $children; } - -// Tags - -function &get_tags($args = '') { - global $wpdb, $category_links; - - $defaults = array('orderby' => 'name', 'order' => 'ASC', - 'hide_empty' => true, 'exclude' => '', 'include' => '', - 'number' => ''); - $args = wp_parse_args( $args, $defaults ); - if ( 'count' == $args['orderby'] ) - $args['orderby'] = 'tag_count'; - else - $args['orderby'] = "cat_" . $args['orderby']; // restricts order by to cat_ID and cat_name fields - $args['number'] = (int) $args['number']; - extract($args); - - $key = md5( serialize( $args ) ); - if ( $cache = wp_cache_get( 'get_tags', 'category' ) ) - if ( isset( $cache[ $key ] ) ) - return apply_filters('get_tags', $cache[$key], $args); - - $where = 'cat_ID > 0'; - $inclusions = ''; - if ( !empty($include) ) { - $child_of = 0; //ignore child_of and exclude params if using include - $exclude = ''; - $incategories = preg_split('/[\s,]+/',$include); - if ( count($incategories) ) { - foreach ( $incategories as $incat ) { - if (empty($inclusions)) - $inclusions = ' AND ( cat_ID = ' . intval($incat) . ' '; - else - $inclusions .= ' OR cat_ID = ' . intval($incat) . ' '; - } - } - } - - if (!empty($inclusions)) - $inclusions .= ')'; - $where .= $inclusions; - - $exclusions = ''; - if ( !empty($exclude) ) { - $excategories = preg_split('/[\s,]+/',$exclude); - if ( count($excategories) ) { - foreach ( $excategories as $excat ) { - if (empty($exclusions)) - $exclusions = ' AND ( cat_ID <> ' . intval($excat) . ' '; - else - $exclusions .= ' AND cat_ID <> ' . intval($excat) . ' '; - } - } - } - - if (!empty($exclusions)) - $exclusions .= ')'; - $exclusions = apply_filters('list_tags_exclusions', $exclusions, $args ); - $where .= $exclusions; - - if ( $hide_empty ) - $where .= ' AND tag_count > 0'; - - $where .= ' AND ( type & ' . TAXONOMY_TAG . ' != 0 ) '; - - if ( !empty($number) ) - $number = 'LIMIT ' . $number; - else - $number = ''; - - $tags = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where ORDER BY $orderby $order $number"); - - if ( empty($tags) ) - return array(); - - $cache[ $key ] = $tags; - wp_cache_set( 'get_tags', $cache, 'category' ); - - $tags = apply_filters('get_tags', $tags, $args); - return $tags; -} - ?> diff --git a/wp-includes/classes.php b/wp-includes/classes.php index d223b6ac62..6c07874122 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -1,7 +1,7 @@ get_results("SELECT post_id, category_id, rel_type FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)"); + $dogs = $wpdb->get_results("SELECT post_id, category_id FROM $wpdb->post2cat WHERE post_id IN ($post_id_list)"); if ( empty($dogs) ) return; - foreach ($dogs as $catt) { - if ( 'category' == $catt->rel_type ) - $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); - elseif ( 'tag' == $catt->rel_type ) - $tag_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); - } + foreach ($dogs as $catt) + $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); } function update_post_caches(&$posts) { - global $post_cache, $category_cache, $post_meta_cache, $tag_cache; + global $post_cache, $category_cache, $post_meta_cache; global $wpdb, $blog_id; // No point in doing all this work if we didn't match any posts. @@ -1475,22 +1468,4 @@ function smilies_init() { } } -function wp_parse_args( $args, $defaults = '' ) { - if ( is_array($args) ) : - $r =& $args; - else : - parse_str( $args, $r ); - if ( get_magic_quotes_gpc() ) - $r = stripslashes_deep( $r ); - endif; - - if ( is_array($defaults) ) : - extract($defaults); - extract($r); - return compact(array_keys($defaults)); // only those options defined in $defaults - else : - return $r; - endif; -} - ?> diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index f41b7224b1..7e7dea1f71 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -59,7 +59,6 @@ function get_permalink($id = 0) { '%postname%', '%post_id%', '%category%', - '%tag%', '%author%', '%pagename%' ); diff --git a/wp-includes/post.php b/wp-includes/post.php index c1097ab4ea..de55c8f89b 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -458,17 +458,6 @@ function wp_get_post_categories($post_id = 0) { return array_unique($cat_ids); } -function wp_get_post_tags( $post_id = 0 ) { - global $tag_cache, $blog_id; - - $post_id = (int) $post_id; - - if ( !isset( $tag_cache[$blog_id][$post_id] ) ) - update_post_category_cache( $post_id ); // loads $tag_cache - - return $tag_cache[$blog_id][$post_id]; -} - function wp_get_recent_posts($num = 10) { global $wpdb; @@ -530,7 +519,6 @@ function wp_insert_post($postarr = array()) { $post_name = apply_filters('name_save_pre', $post_name); $comment_status = apply_filters('comment_status_pre', $comment_status); $ping_status = apply_filters('ping_status_pre', $ping_status); - $tags_input = apply_filters('tags_input_pre', $tags_input); } if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) @@ -665,8 +653,7 @@ function wp_insert_post($postarr = array()) { $wpdb->query( "UPDATE $wpdb->posts SET post_name = '$post_name' WHERE ID = '$post_ID'" ); } - wp_set_post_categories( $post_ID, $post_category ); - wp_set_post_tags( $post_ID, $tags_input ); + wp_set_post_categories($post_ID, $post_category); if ( 'page' == $post_type ) { clean_page_cache($post_ID); @@ -784,90 +771,6 @@ function wp_publish_post($post_id) { return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id, 'no_filter' => true)); } -function wp_add_post_tags($post_id = 0, $tags = '') { - return wp_set_post_tags($post_id, $tags, true); -} - -function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { - /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */ - global $wpdb; - - $post_id = (int) $post_id; - - if ( !$post_id ) - return false; - - // prevent warnings for unintialized variables - $tag_ids = array(); - - if ( empty($tags) ) - $tags = array(); - $tags = (is_array($tags)) ? $tags : explode( ',', $tags ); - - foreach ( $tags as $tag ) { - $tag = trim( $tag ); - if ( !$tag_slug = sanitize_title( $tag ) ) - continue; // discard - if ( !$tag_id = tag_exists( $tag ) ) - $tag_id = wp_create_tag( $tag ); - $tag_ids[] = $tag_id; - } - - if ( empty($tag_ids) && ( !empty($tags) || $append ) ) - return false; - - $tag_ids = array_unique( $tag_ids ); - - // First the old tags - $old_tags = $wpdb->get_col(" - SELECT category_id - FROM $wpdb->post2cat - WHERE post_id = '$post_id' AND rel_type = 'tag'"); - - if ( !$old_tags ) { - $old_tags = array(); - } else { - $old_tags = array_unique( $old_tags ); - } - - // Delete any? - $delete_tags = array_diff( $old_tags, $tag_ids); - if ( $delete_tags && !$append ) { - foreach ( $delete_tags as $del ) { - $wpdb->query(" - DELETE FROM $wpdb->post2cat - WHERE category_id = '$del' - AND post_id = '$post_id' - AND rel_type = 'tag' - "); - } - } - - // Add any? - $add_tags = array_diff( $tag_ids, $old_tags ); - if ( $add_tags ) { - foreach ( $add_tags as $new_tag ) { - $new_tag = (int) $new_tag; - if ( !empty($new_tag) ) - $wpdb->query(" - INSERT INTO $wpdb->post2cat (post_id, category_id, rel_type) - VALUES ('$post_id', '$new_tag', 'tag')"); - } - } - - // Update category counts. - $all_affected_tags = array_unique( array_merge( $tag_ids, $old_tags ) ); - foreach ( $all_affected_tags as $tag_id ) { - $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status = 'publish' AND post_type = 'post' AND category_id = '$tag_id' AND rel_type = 'tag'" ); - $wpdb->query( "UPDATE $wpdb->categories SET tag_count = '$count', type = type | " . TAXONOMY_TAG . " WHERE cat_ID = '$tag_id'" ); - if ( $count == 0 ) - $wpdb->query( "UPDATE $wpdb->categories SET type = type & ~". TAXONOMY_TAG . " WHERE cat_ID = '$tag_id'" ); - clean_category_cache( $tag_id ); - do_action( 'edit_category', $tag_id ); - do_action( 'edit_tag', $tag_id ); - } -} - function wp_set_post_categories($post_ID = 0, $post_categories = array()) { global $wpdb; @@ -882,7 +785,7 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { $old_categories = $wpdb->get_col(" SELECT category_id FROM $wpdb->post2cat - WHERE post_id = '$post_ID' AND rel_type = 'category'"); + WHERE post_id = '$post_ID'"); if (!$old_categories) { $old_categories = array(); @@ -898,7 +801,7 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { $wpdb->query(" DELETE FROM $wpdb->post2cat WHERE category_id = '$del' - AND post_id = '$post_ID' AND rel_type = 'category' + AND post_id = '$post_ID' "); } } @@ -919,8 +822,8 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { // Update category counts. $all_affected_cats = array_unique(array_merge($post_categories, $old_categories)); foreach ( $all_affected_cats as $cat_id ) { - $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status = 'publish' AND post_type = 'post' AND category_id = '$cat_id' AND rel_type = 'category'"); - $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count', type = type | " . TAXONOMY_CATEGORY . " WHERE cat_ID = '$cat_id'"); + $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status = 'publish' AND post_type = 'post' AND category_id = '$cat_id'"); + $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); clean_category_cache($cat_id); do_action('edit_category', $cat_id); } diff --git a/wp-includes/query.php b/wp-includes/query.php index 67bfa16cea..16bc76085d 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -86,20 +86,6 @@ function is_category ($category = '') { return false; } -function is_tag( $slug = '' ) { - global $wp_query; - if ( !$wp_query->is_tag ) - return false; - - if ( empty( $slug ) ) - return true; - - $cat_obj = $wp_query->get_queried_object(); - if ( $category == $cat_obj->category_nicename ) - return true; - return false; -} - function is_comments_popup () { global $wp_query; @@ -319,7 +305,6 @@ class WP_Query { var $is_time = false; var $is_author = false; var $is_category = false; - var $is_tag = false; var $is_search = false; var $is_feed = false; var $is_comment_feed = false; @@ -344,7 +329,6 @@ class WP_Query { $this->is_time = false; $this->is_author = false; $this->is_category = false; - $this->is_tag = false; $this->is_search = false; $this->is_feed = false; $this->is_comment_feed = false; @@ -399,7 +383,6 @@ class WP_Query { , 'year' , 'w' , 'category_name' - , 'tag' , 'author_name' , 'feed' , 'tb' @@ -548,9 +531,6 @@ class WP_Query { $this->is_category = true; } - if ( '' != $qv['tag'] ) - $this->is_tag = true; - if ( empty($qv['author']) || ($qv['author'] == '0') ) { $this->is_author = false; } else { @@ -561,7 +541,7 @@ class WP_Query { $this->is_author = true; } - if ( ($this->is_date || $this->is_author || $this->is_category || $this->is_tag ) ) + if ( ($this->is_date || $this->is_author || $this->is_category) ) $this->is_archive = true; } @@ -857,7 +837,7 @@ class WP_Query { $in_cats = substr($in_cats, 0, -2); $out_cats = substr($out_cats, 0, -2); if ( strlen($in_cats) > 0 ) - $in_cats = " AND $wpdb->post2cat.category_id IN ($in_cats) AND rel_type = 'category' "; + $in_cats = " AND $wpdb->post2cat.category_id IN ($in_cats)"; if ( strlen($out_cats) > 0 ) { $ids = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.category_id IN ($out_cats)"); if ( is_array($ids) && count($ids > 0) ) { @@ -874,21 +854,6 @@ class WP_Query { $groupby = "{$wpdb->posts}.ID"; } - if ( '' != $q['tag'] ) { - $reqcat= get_category_by_slug( $q['tag'] ); - if ( !empty($reqcat) ) - $reqcat = $reqcat->cat_ID; - else - $reqcat = 0; - - $q['cat'] = $reqcat; - - $tables = ", $wpdb->post2cat, $wpdb->categories"; - $join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) "; - $whichcat = " AND category_id IN ({$q['cat']}) AND rel_type = 'tag' "; - $groupby = "{$wpdb->posts}.ID"; - } - // Category stuff for nice URLs if ( '' != $q['category_name'] ) { $reqcat = get_category_by_path($q['category_name']); diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index cf545aa819..1d46aa6701 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -46,12 +46,11 @@ define('EP_ROOT', 64 ); define('EP_COMMENTS', 128 ); define('EP_SEARCH', 256 ); define('EP_CATEGORIES', 512 ); -define('EP_TAGS', 1024 ); -define('EP_AUTHORS', 2048); -define('EP_PAGES', 4096); +define('EP_AUTHORS', 1024); +define('EP_PAGES', 2048); //pseudo-places define('EP_NONE', 0 ); -define('EP_ALL', 8191); +define('EP_ALL', 4095); //and an endpoint, like /trackback/ function add_rewrite_endpoint($name, $places) { @@ -153,9 +152,7 @@ class WP_Rewrite { var $permalink_structure; var $use_trailing_slashes; var $category_base; - var $tag_base; var $category_structure; - var $tag_structure; var $author_base = 'author'; var $author_structure; var $date_structure; @@ -186,7 +183,6 @@ class WP_Rewrite { '%postname%', '%post_id%', '%category%', - '%tag%', '%author%', '%pagename%', '%search%' @@ -203,7 +199,6 @@ class WP_Rewrite { '([^/]+)', '([0-9]+)', '(.+?)', - '(.+?)', '([^/]+)', '([^/]+)', '(.+)' @@ -220,7 +215,6 @@ class WP_Rewrite { 'name=', 'p=', 'category_name=', - 'tag=', 'author_name=', 'pagename=', 's=' @@ -386,26 +380,6 @@ class WP_Rewrite { return $this->category_structure; } - function get_tag_permastruct() { - if (isset($this->tag_structure)) { - return $this->tag_structure; - } - - if (empty($this->permalink_structure)) { - $this->tag_structure = ''; - return false; - } - - if (empty($this->tag_base)) - $this->tag_structure = $this->front . 'tag/'; - else - $this->tag_structure = $this->tag_base . '/'; - - $this->tag_structure .= '%tag%'; - - return $this->tag_structure; - } - function get_author_permastruct() { if (isset($this->author_structure)) { return $this->author_structure; @@ -762,10 +736,6 @@ class WP_Rewrite { $category_rewrite = $this->generate_rewrite_rules($this->get_category_permastruct(), EP_CATEGORIES); $category_rewrite = apply_filters('category_rewrite_rules', $category_rewrite); - // Tags - $tag_rewrite = $this->generate_rewrite_rules($this->get_tag_permastruct(), EP_TAGS); - $tag_rewrite = apply_filters('tag_rewrite_rules', $tag_rewrite); - // Authors $author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS); $author_rewrite = apply_filters('author_rewrite_rules', $author_rewrite); @@ -775,7 +745,7 @@ class WP_Rewrite { $page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite); // Put them together. - $this->rules = array_merge($robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules); + $this->rules = array_merge($robots_rewrite, $default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules); do_action_ref_array('generate_rewrite_rules', array(&$this)); $this->rules = apply_filters('rewrite_rules_array', $this->rules); @@ -901,8 +871,7 @@ class WP_Rewrite { if ($this->using_index_permalinks()) { $this->root = $this->index . '/'; } - $this->category_base = get_option( 'category_base' ); - $this->tag_base = get_option( 'tag_base' ); + $this->category_base = get_option('category_base'); unset($this->category_structure); unset($this->author_structure); unset($this->date_structure); @@ -927,13 +896,6 @@ class WP_Rewrite { } } - function set_tag_base( $tag_base ) { - if ( $tag_base != $this->tag_base ) { - update_option( 'tag_base', $tag_base ); - $this->init(); - } - } - function WP_Rewrite() { $this->init(); } diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php index 80ba5dc339..5b830c679a 100644 --- a/wp-includes/template-loader.php +++ b/wp-includes/template-loader.php @@ -35,9 +35,6 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { } else if ( is_category() && $template = get_category_template()) { include($template); return; - } else if ( is_tag() && $template = get_tag_template()) { - include($template); - return; } else if ( is_author() && $template = get_author_template() ) { include($template); return; diff --git a/wp-includes/theme.php b/wp-includes/theme.php index f359b0855d..2a7ac8ce0c 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -328,17 +328,6 @@ function get_category_template() { return apply_filters('category_template', $template); } -function get_tag_template() { - $template = ''; - if ( file_exists(TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php') ) - $template = TEMPLATEPATH . "/tag-" . get_query_var('tag') . '.php'; - elseif ( file_exists(TEMPLATEPATH . "/tag.php") ) - $template = TEMPLATEPATH . "/tag.php"; - - return apply_filters('tag_template', $template); -} - - function get_date_template() { return get_query_template('date'); } diff --git a/xmlrpc.php b/xmlrpc.php index 353a44aad6..4d5231d8cf 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -1554,7 +1554,7 @@ class wp_xmlrpc_server extends IXR_Server { $categories_struct = array(); // FIXME: can we avoid using direct SQL there? - if ($cats = $wpdb->get_results("SELECT cat_ID, cat_name FROM $wpdb->categories WHERE (type & " . TAXONOMY_CATEGORY . " != 0)", ARRAY_A)) { + if ($cats = $wpdb->get_results("SELECT cat_ID, cat_name FROM $wpdb->categories", ARRAY_A)) { foreach ($cats as $cat) { $struct['categoryId'] = $cat['cat_ID']; $struct['categoryName'] = $cat['cat_name'];