Add single_cat_title filter. Props ryanscheuermann. fixes #2935
git-svn-id: http://svn.automattic.com/wordpress/trunk@4116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f1664e6dd0
commit
e650a94fd0
@ -149,7 +149,7 @@ function wp_title($sep = '»', $display = true) {
|
|||||||
if ( !empty($cat) ) {
|
if ( !empty($cat) ) {
|
||||||
// category exclusion
|
// category exclusion
|
||||||
if ( !stristr($cat,'-') )
|
if ( !stristr($cat,'-') )
|
||||||
$title = get_the_category_by_ID($cat);
|
$title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
|
||||||
}
|
}
|
||||||
if ( !empty($category_name) ) {
|
if ( !empty($category_name) ) {
|
||||||
if ( stristr($category_name,'/') ) {
|
if ( stristr($category_name,'/') ) {
|
||||||
@ -160,6 +160,7 @@ function wp_title($sep = '»', $display = true) {
|
|||||||
$category_name = $category_name[count($category_name)-2]; // there was a trailling slash
|
$category_name = $category_name[count($category_name)-2]; // there was a trailling slash
|
||||||
}
|
}
|
||||||
$title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
|
$title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
|
||||||
|
$title = apply_filters('single_cat_title', $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's an author
|
// If there's an author
|
||||||
@ -230,7 +231,7 @@ function single_post_title($prefix = '', $display = true) {
|
|||||||
function single_cat_title($prefix = '', $display = true ) {
|
function single_cat_title($prefix = '', $display = true ) {
|
||||||
$cat = intval( get_query_var('cat') );
|
$cat = intval( get_query_var('cat') );
|
||||||
if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) {
|
if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) {
|
||||||
$my_cat_name = get_the_category_by_ID($cat);
|
$my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat));
|
||||||
if ( !empty($my_cat_name) ) {
|
if ( !empty($my_cat_name) ) {
|
||||||
if ( $display )
|
if ( $display )
|
||||||
echo $prefix.strip_tags($my_cat_name);
|
echo $prefix.strip_tags($my_cat_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user