WordPress.org

Make WordPress Core

Changeset 5912


Ignore:
Timestamp:
08/21/2007 06:39:45 PM (11 years ago)
Author:
ryan
Message:

Some tag api additions from andy.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r5818 r5912  
    129129
    130130
    131     $tags = get_terms('post_tag');
     131    $tags = get_terms('post_tag', $args);
    132132
    133133    if ( empty($tags) )
  • trunk/wp-includes/general-template.php

    r5780 r5912  
    273273            else
    274274                return strip_tags($my_cat_name);
     275        }
     276    }
     277}
     278
     279
     280function single_tag_title($prefix = '', $display = true ) {
     281    $tag_id = intval( get_query_var('tag_id') );
     282    if ( !empty($tag_id) ) {
     283        $my_tag = &get_term($tag_id, 'post_tag');
     284        $my_tag_name = apply_filters('single_tag_title', $my_tag->name);
     285        if ( !empty($my_tag_name) ) {
     286            if ( $display )
     287                echo $prefix.strip_tags($my_tag_name);
     288            else
     289                return strip_tags($my_tag_name);
    275290        }
    276291    }
  • trunk/wp-includes/query.php

    r5907 r5912  
    12951295            $this->queried_object = &$category;
    12961296            $this->queried_object_id = (int) $cat;
     1297        } else if ($this->is_tag) {
     1298            $tag_id = $this->get('tag_id');
     1299            $tag = &get_term($tag_id, 'post_tag');
     1300            $this->queried_object = &$tag;
     1301            $this->queried_object_id = (int) $tag_id;
    12971302        } else if ($this->is_posts_page) {
    12981303            $this->queried_object = & get_page(get_option('page_for_posts'));
Note: See TracChangeset for help on using the changeset viewer.