Changeset 3805 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 03/16/2012 05:26:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r3785 r3805 924 924 * @param int $topic_id Optional. Topic id 925 925 * @uses bbp_get_topic_status() To get the topic status 926 * @uses apply_filters() Calls 'bbp_is_topic_closed' with the topic id 927 * 926 928 * @return bool True if closed, false if not. 927 929 */ 928 930 function bbp_is_topic_closed( $topic_id = 0 ) { 929 if ( bbp_get_closed_status_id() == bbp_get_topic_status( $topic_id ) ) 930 return true; 931 932 return false; 931 $closed = bbp_get_topic_status( $topic_id ) == bbp_get_closed_status_id(); 932 return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id ); 933 933 } 934 934 … … 984 984 * @uses bbp_get_topic_id() To get the topic id 985 985 * @uses bbp_get_topic_status() To get the topic status 986 * @uses apply_filters() Calls 'bbp_is_topic_published' with the topic id 986 987 * @return bool True if published, false if not. 987 988 */ 988 989 function bbp_is_topic_published( $topic_id = 0 ) { 989 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) ;990 return bbp_get_public_status_id() == $topic_status;990 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_public_status_id(); 991 return (bool) apply_filters( 'bbp_is_topic_published', (bool) $topic_status, $topic_id ); 991 992 } 992 993 … … 999 1000 * @uses bbp_get_topic_id() To get the topic id 1000 1001 * @uses bbp_get_topic_status() To get the topic status 1002 * @uses apply_filters() Calls 'bbp_is_topic_spam' with the topic id 1001 1003 * @return bool True if spam, false if not. 1002 1004 */ 1003 1005 function bbp_is_topic_spam( $topic_id = 0 ) { 1004 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) ;1005 return bbp_get_spam_status_id() == $topic_status;1006 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_spam_status_id(); 1007 return (bool) apply_filters( 'bbp_is_topic_spam', (bool) $topic_status, $topic_id ); 1006 1008 } 1007 1009 … … 1014 1016 * @uses bbp_get_topic_id() To get the topic id 1015 1017 * @uses bbp_get_topic_status() To get the topic status 1018 * @uses apply_filters() Calls 'bbp_is_topic_trash' with the topic id 1016 1019 * @return bool True if trashed, false if not. 1017 1020 */ 1018 1021 function bbp_is_topic_trash( $topic_id = 0 ) { 1019 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) ;1020 return bbp_get_trash_status_id() == $topic_status;1022 $topic_status = bbp_get_topic_status( bbp_get_topic_id( $topic_id ) ) == bbp_get_trash_status_id(); 1023 return (bool) apply_filters( 'bbp_is_topic_trash', (bool) $topic_status, $topic_id ); 1021 1024 } 1022 1025 … … 1030 1033 * @uses bbp_get_topic_author_id() To get the topic author id 1031 1034 * @uses get_post_meta() To get the anonymous user name and email meta 1035 * @uses apply_filters() Calls 'bbp_is_topic_anonymous' with the topic id 1032 1036 * @return bool True if the post is by an anonymous user, false if not. 1033 1037 */ 1034 1038 function bbp_is_topic_anonymous( $topic_id = 0 ) { 1035 1039 $topic_id = bbp_get_topic_id( $topic_id ); 1036 1037 if ( 0 != bbp_get_topic_author_id( $topic_id ) ) 1038 return false; 1039 1040 if ( false == get_post_meta( $topic_id, '_bbp_anonymous_name', true ) ) 1041 return false; 1042 1043 if ( false == get_post_meta( $topic_id, '_bbp_anonymous_email', true ) ) 1044 return false; 1040 $retval = false; 1041 1042 if ( !bbp_get_topic_author_id( $topic_id ) ) 1043 $retval = true; 1044 1045 elseif ( get_post_meta( $topic_id, '_bbp_anonymous_name', true ) ) 1046 $retval = true; 1047 1048 elseif ( get_post_meta( $topic_id, '_bbp_anonymous_email', true ) ) 1049 $retval = true; 1045 1050 1046 1051 // The topic is by an anonymous user 1047 return true;1052 return (bool) apply_filters( 'bbp_is_topic_anonymous', $retval, $topic_id ); 1048 1053 } 1049 1054
Note: See TracChangeset
for help on using the changeset viewer.