wp_title filter help
-
any idea as to why a filter would never get executed. i’ve got an issue where i’m trying to set <title></title> for BP forums pages. i copied some code from the BP.org that looks something like the following:
/* add page title to buddypress forum pages */
echo ‘<script type=”text/javascript”>alert(“here1”)</script>’;
function my_page_title( $title, $b )
{ global $bp;echo ‘<script type=”text/javascript”>alert(“here2”)</script>’;
if ( bp_is_group_forum_topic() ) {
$topic_title = bp_get_the_topic_title();
$title .= ‘ | ‘ . $topic_title;
}return $title;
}add_filter( ‘bp_page_title’, ‘my_page_title’, 10, 2);
echo ‘<script type=”text/javascript”>alert(“here3”)</script>’;but that didn’t seem to work (the alert1 and alert3 execute, but i never see the alert2). i tried changing the filter from bp_page_title to wp_title thinking maybe it was an incorectly specified filter in BP, but that didn’t seem to make a difference.
any ideas?
The topic ‘wp_title filter help’ is closed to new replies.