Support » Plugins » wp_title filter help

  • Resolved blasher


    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 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?

Viewing 1 replies (of 1 total)
  • never mind. it works, but only for non-BP-generated pages. i don’t understand why, but that’s what’s happenning.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_title filter help’ is closed to new replies.