get_queried_object should not return an array of terms, and wp_title should check is_tax. Hat tip: andy
git-svn-id: http://svn.automattic.com/wordpress/trunk@7941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7b0c0703f5
commit
2d8fa9ee21
|
@ -233,6 +233,19 @@ function wp_title($sep = '»', $display = true, $seplocation = '') {
|
||||||
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
|
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there's a taxonomy
|
||||||
|
if ( is_tax() ) {
|
||||||
|
$taxonomy = get_query_var( 'taxonomy' );
|
||||||
|
$tax = get_taxonomy( $taxonomy );
|
||||||
|
$tax = $tax->label;
|
||||||
|
$term = $wp_query->get_queried_object();
|
||||||
|
$term = $term->name;
|
||||||
|
if ( 'right' == $seplocation )
|
||||||
|
$title = "$term $sep $tax";
|
||||||
|
else
|
||||||
|
$title = "$tax $sep $term";
|
||||||
|
}
|
||||||
|
|
||||||
$prefix = '';
|
$prefix = '';
|
||||||
if ( !empty($title) )
|
if ( !empty($title) )
|
||||||
$prefix = " $sep ";
|
$prefix = " $sep ";
|
||||||
|
|
|
@ -1610,8 +1610,9 @@ class WP_Query {
|
||||||
$tax = $this->get('taxonomy');
|
$tax = $this->get('taxonomy');
|
||||||
$slug = $this->get('term');
|
$slug = $this->get('term');
|
||||||
$term = &get_terms($tax, array('slug'=>$slug));
|
$term = &get_terms($tax, array('slug'=>$slug));
|
||||||
if ( is_wp_error($term) )
|
if ( is_wp_error($term) || empty($term) )
|
||||||
return $term;
|
return $term;
|
||||||
|
$term = $term[0];
|
||||||
$this->queried_object = $term;
|
$this->queried_object = $term;
|
||||||
$this->queried_object_id = $term->term_id;
|
$this->queried_object_id = $term->term_id;
|
||||||
} else if ($this->is_posts_page) {
|
} else if ($this->is_posts_page) {
|
||||||
|
|
Loading…
Reference in New Issue