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
2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 | 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.