Hi,
You will have to check the bbp_topic_admin_links, something like:
add_filter ('bbp_topic_admin_links', 'change_topic_admin_links' );
function change_topic_admin_links ($r) {
// whatever is needed here
return $r;
}
Pascal.
Thank you. I’m having a little bit of trouble.
I found the original function I need to edit in bbpress/includes/topics/template.php:
function bbp_get_topic_reply_link( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'id' => 0,
'link_before' => '',
'link_after' => '',
'reply_text' => esc_html__( 'Reply', 'bbpress' ),
), 'get_topic_reply_link' );
// Get the reply to use it's ID and post_parent
$topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
// Bail if no reply or user cannot reply
if ( empty( $topic ) || ! bbp_current_user_can_access_create_reply_form() )
return;
$uri = '#new-post';
// Add $uri to the array, to be passed through the filter
$r['uri'] = $uri;
$retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];
return apply_filters( 'bbp_get_topic_reply_link', $retval, $r, $args );
}
The only line I need to modify is:
$retval = $r['link_before'] . '<a href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];
Is there an easier way to phrase my new function to modify just this variable?
Hi,
For sure NEVER edit files under bbPress, otherwise you loose it when there is an upgrade.
If you could give me an example of what you get now and what you would need to get, I could maybe help you further. Or a link to your site and then what would need to be changed.
Thanks, Pascal.