Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Editing Group and Forum page title tags


snark
Participant

@snark

Ok, I figured it out. In the RC3 version of bp-forums-templatetags.php, it says the old function this was calling has been deprecated, and what to replace it with:

/* DEPRECATED use bp_has_forum_topic_posts() */

function bp_has_topic_posts() { return bp_has_forum_topic_posts( $args ); }

function bp_forum_topic_posts() {

global $topic_template;

return $topic_template->user_posts();

}

/* DEPRECATED use bp_forum_topic_posts() */

function bp_topic_posts() { return bp_forum_topic_posts(); }

function bp_the_forum_topic_post() {

global $topic_template;

return $topic_template->the_post();

}

/* DEPRECATED use bp_the_forum_topic_post() */

function bp_the_topic_post() { return bp_the_forum_topic_post(); }

So I swapped the offending line and now have it working again using this function in my child theme functions.php file:

/* Custom function to re-write Forum title tags */

function my_page_title( $title, $b ) {

global $bp;

if ( $bp->current_action == ‘forum’ && $bp->action_variables[0] == ‘topic’ ) {

if ( bp_has_forum_topic_posts() ) {

$topic_title = bp_get_the_topic_title();

$title .= ‘ | ‘ . $topic_title;

$title = str_replace( ‘ | Groups’, ”, $title );

$title = str_replace( ‘ | Forum’, ”, $title );

}

}

return $title;

}

add_filter( ‘bp_page_title’, ‘my_page_title’, 10, 2 );

?>

Skip to toolbar