diff --git a/src/includes/forums/template.php b/src/includes/forums/template.php
index 9dc6b378..12374fa1 100644
|
a
|
b
|
function bbp_forum_visibility( $forum_id = 0 ) {
|
| 1534 | 1534 | * @uses get_post_status() To get the forum's status |
| 1535 | 1535 | * @uses apply_filters() Calls 'bbp_get_forum_visibility' with the visibility |
| 1536 | 1536 | * and forum id |
| 1537 | | * @return string Status of forum |
| | 1537 | * @return string Status of forum. Defaults to empty string. |
| 1538 | 1538 | */ |
| 1539 | 1539 | function bbp_get_forum_visibility( $forum_id = 0 ) { |
| 1540 | 1540 | $forum_id = bbp_get_forum_id( $forum_id ); |
| 1541 | | $visibility = get_post_status( $forum_id ); |
| | 1541 | $visibility = empty( $forum_id ) ? '' : get_post_status( $forum_id ); |
| 1542 | 1542 | |
| 1543 | 1543 | return apply_filters( 'bbp_get_forum_visibility', $visibility, $forum_id ); |
| 1544 | 1544 | } |
| … |
… |
function bbp_is_forum_category( $forum_id = 0 ) {
|
| 1603 | 1603 | * @return bool Whether the forum is open or not |
| 1604 | 1604 | */ |
| 1605 | 1605 | function bbp_is_forum_open( $forum_id = 0, $check_ancestors = true ) { |
| 1606 | | return ! bbp_is_forum_closed( $forum_id, $check_ancestors ); |
| | 1606 | $forum_id = bbp_get_forum_id( $forum_id ); |
| | 1607 | $open = empty( $forum_id ) ? false : ( ! bbp_is_forum_closed( $forum_id, $check_ancestors ) ); |
| | 1608 | return $open; |
| 1607 | 1609 | } |
| 1608 | 1610 | |
| 1609 | 1611 | /** |
diff --git a/src/includes/replies/template.php b/src/includes/replies/template.php
index edb7b37e..7748a801 100644
|
a
|
b
|
function bbp_reply_status( $reply_id = 0 ) {
|
| 903 | 903 | * @uses bbp_get_reply_id() To get the reply id |
| 904 | 904 | * @uses get_post_status() To get the reply status |
| 905 | 905 | * @uses apply_filters() Calls 'bbp_get_reply_status' with the reply id |
| 906 | | * @return string Status of reply |
| | 906 | * @return string Status of reply. Defaults to empty string. |
| 907 | 907 | */ |
| 908 | 908 | function bbp_get_reply_status( $reply_id = 0 ) { |
| 909 | 909 | $reply_id = bbp_get_reply_id( $reply_id ); |
| 910 | | return apply_filters( 'bbp_get_reply_status', get_post_status( $reply_id ), $reply_id ); |
| | 910 | $status = empty( $reply_id ) ? '' : get_post_status( $reply_id ); |
| | 911 | |
| | 912 | return apply_filters( 'bbp_get_reply_status', $status, $reply_id ); |
| 911 | 913 | } |
| 912 | 914 | |
| 913 | 915 | /** |
| … |
… |
function bbp_is_reply_anonymous( $reply_id = 0 ) {
|
| 1002 | 1004 | $reply_id = bbp_get_reply_id( $reply_id ); |
| 1003 | 1005 | $retval = false; |
| 1004 | 1006 | |
| | 1007 | // Bail early if no reply id. |
| | 1008 | if ( empty( $reply_id ) ) { |
| | 1009 | return false; |
| | 1010 | } |
| | 1011 | |
| 1005 | 1012 | if ( ! bbp_get_reply_author_id( $reply_id ) ) { |
| 1006 | 1013 | $retval = true; |
| 1007 | 1014 | |
diff --git a/src/includes/topics/template.php b/src/includes/topics/template.php
index efe36e41..5ec2de87 100644
|
a
|
b
|
function bbp_topic_status( $topic_id = 0 ) {
|
| 1143 | 1143 | * @uses get_post_status() To get the topic status |
| 1144 | 1144 | * @uses apply_filters() Calls 'bbp_get_topic_status' with the status |
| 1145 | 1145 | * and topic id |
| 1146 | | * @return string Status of topic |
| | 1146 | * @return string Status of topic. Defaults to empty string. |
| 1147 | 1147 | */ |
| 1148 | 1148 | function bbp_get_topic_status( $topic_id = 0 ) { |
| 1149 | 1149 | $topic_id = bbp_get_topic_id( $topic_id ); |
| | 1150 | $status = empty( $topic_id ) ? '' : get_post_status( $topic_id ); |
| 1150 | 1151 | |
| 1151 | | return apply_filters( 'bbp_get_topic_status', get_post_status( $topic_id ), $topic_id ); |
| | 1152 | return apply_filters( 'bbp_get_topic_status', $status, $topic_id ); |
| 1152 | 1153 | } |
| 1153 | 1154 | |
| 1154 | 1155 | /** |
| … |
… |
function bbp_is_topic_closed( $topic_id = 0 ) {
|
| 1182 | 1183 | * @return bool True if open, false if closed. |
| 1183 | 1184 | */ |
| 1184 | 1185 | function bbp_is_topic_open( $topic_id = 0 ) { |
| 1185 | | return ! bbp_is_topic_closed( $topic_id ); |
| | 1186 | $topic_id = bbp_get_topic_id( $topic_id ); |
| | 1187 | $closed = empty( $topic_id ) ? false : ( ! bbp_is_topic_closed( $topic_id ) ); |
| | 1188 | return $closed; |
| 1186 | 1189 | } |
| 1187 | 1190 | |
| 1188 | 1191 | /** |
| … |
… |
function bbp_is_topic_anonymous( $topic_id = 0 ) {
|
| 1296 | 1299 | $topic_id = bbp_get_topic_id( $topic_id ); |
| 1297 | 1300 | $retval = false; |
| 1298 | 1301 | |
| | 1302 | // Bail early if no topic id. |
| | 1303 | if ( empty( $topic_id ) ) { |
| | 1304 | return false; |
| | 1305 | } |
| | 1306 | |
| 1299 | 1307 | if ( ! bbp_get_topic_author_id( $topic_id ) ) { |
| 1300 | 1308 | $retval = true; |
| 1301 | 1309 | |