bbp_get_forum_replies_feed_link( int $forum_id )
Retrieve the link for the forum replies feed
Description
Parameters
- $forum_id
-
(Optional) Forum ID.
Return
(string)
Source
File: bp-forums/forums/template.php
function bbp_get_forum_replies_feed_link( $forum_id = 0 ) { // Validate forum id $forum_id = bbp_get_forum_id( $forum_id ); // Forum is valid if ( !empty( $forum_id ) ) { // Define local variable(s) $link = ''; // Pretty permalinks if ( get_option( 'permalink_structure' ) ) { // Forum link $url = trailingslashit( bbp_get_forum_permalink( $forum_id ) ) . 'feed'; $url = user_trailingslashit( $url, 'single_feed' ); $url = add_query_arg( array( 'type' => 'reply' ), $url ); // Unpretty permalinks } else { $url = home_url( add_query_arg( array( 'type' => 'reply', 'feed' => 'rss2', bbp_get_forum_post_type() => get_post_field( 'post_name', $forum_id ) ) ) ); } $link = '<a href="' . esc_url( $url ) . '" class="bbp-forum-rss-link replies"><span>' . esc_html__( 'Replies', 'buddyboss' ) . '</span></a>'; } return apply_filters( 'bbp_get_forum_replies_feed_link', $link, $url, $forum_id ); }
Changelog
Version | Description |
---|---|
bbPress (r3172) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.