Changeset 5682
- Timestamp:
- 04/15/2015 02:34:21 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r5681 r5682 1079 1079 1080 1080 /** 1081 * Output the status of the topic1082 *1083 * @since bbPress (r2667)1084 *1085 * @param int $topic_id Optional. Topic id1086 * @uses bbp_get_topic_status() To get the topic status1087 */1088 function bbp_topic_status( $topic_id = 0 ) {1089 echo bbp_get_topic_status( $topic_id );1090 }1091 /**1092 * Return the status of the topic1093 *1094 * @since bbPress (r2667)1095 *1096 * @param int $topic_id Optional. Topic id1097 * @uses bbp_get_topic_id() To get the topic id1098 * @uses get_post_status() To get the topic status1099 * @uses apply_filters() Calls 'bbp_get_topic_status' with the status1100 * and topic id1101 * @return string Status of topic1102 */1103 function bbp_get_topic_status( $topic_id = 0 ) {1104 $topic_id = bbp_get_topic_id( $topic_id );1105 1106 return apply_filters( 'bbp_get_topic_status', get_post_status( $topic_id ), $topic_id );1107 }1108 1109 /**1110 * Is the topic open to new replies?1111 *1112 * @since bbPress (r2727)1113 *1114 * @uses bbp_get_topic_status()1115 *1116 * @param int $topic_id Optional. Topic id1117 * @uses bbp_is_topic_closed() To check if the topic is closed1118 * @return bool True if open, false if closed.1119 */1120 function bbp_is_topic_open( $topic_id = 0 ) {1121 return ! bbp_is_topic_closed( $topic_id );1122 }1123 1124 /**1125 * Is the topic closed to new replies?1126 *1127 * @since bbPress (r2746)1128 *1129 * @param int $topic_id Optional. Topic id1130 * @uses bbp_get_topic_status() To get the topic status1131 * @uses apply_filters() Calls 'bbp_is_topic_closed' with the topic id1132 *1133 * @return bool True if closed, false if not.1134 */1135 function bbp_is_topic_closed( $topic_id = 0 ) {1136 $closed = bbp_get_topic_status( $topic_id ) === bbp_get_closed_status_id();1137 return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $closed, $topic_id );1138 }1139 1140 /**1141 1081 * Is the topic a sticky or super sticky? 1142 1082 * … … 1183 1123 1184 1124 return (bool) apply_filters( 'bbp_is_topic_super_sticky', $retval, $topic_id ); 1125 } 1126 1127 /** 1128 * Output the status of the topic 1129 * 1130 * @since bbPress (r2667) 1131 * 1132 * @param int $topic_id Optional. Topic id 1133 * @uses bbp_get_topic_status() To get the topic status 1134 */ 1135 function bbp_topic_status( $topic_id = 0 ) { 1136 echo bbp_get_topic_status( $topic_id ); 1137 } 1138 /** 1139 * Return the status of the topic 1140 * 1141 * @since bbPress (r2667) 1142 * 1143 * @param int $topic_id Optional. Topic id 1144 * @uses bbp_get_topic_id() To get the topic id 1145 * @uses get_post_status() To get the topic status 1146 * @uses apply_filters() Calls 'bbp_get_topic_status' with the status 1147 * and topic id 1148 * @return string Status of topic 1149 */ 1150 function bbp_get_topic_status( $topic_id = 0 ) { 1151 $topic_id = bbp_get_topic_id( $topic_id ); 1152 1153 return apply_filters( 'bbp_get_topic_status', get_post_status( $topic_id ), $topic_id ); 1154 } 1155 1156 /** 1157 * Is the topic closed to new replies? 1158 * 1159 * @since bbPress (r2746) 1160 * 1161 * @param int $topic_id Optional. Topic id 1162 * @uses bbp_get_topic_status() To get the topic status 1163 * @uses apply_filters() Calls 'bbp_is_topic_closed' with the topic id 1164 * 1165 * @return bool True if closed, false if not. 1166 */ 1167 function bbp_is_topic_closed( $topic_id = 0 ) { 1168 $topic_id = bbp_get_topic_id( $topic_id ); 1169 $status = bbp_get_closed_status_id(); 1170 $topic_status = bbp_get_topic_status( $topic_id ) === $status; 1171 1172 return (bool) apply_filters( 'bbp_is_topic_closed', (bool) $topic_status, $topic_id ); 1173 } 1174 1175 /** 1176 * Is the topic open to new replies? 1177 * 1178 * @since bbPress (r2727) 1179 * 1180 * @uses bbp_get_topic_status() 1181 * 1182 * @param int $topic_id Optional. Topic id 1183 * @uses bbp_is_topic_closed() To check if the topic is closed 1184 * @return bool True if open, false if closed. 1185 */ 1186 function bbp_is_topic_open( $topic_id = 0 ) { 1187 return ! bbp_is_topic_closed( $topic_id ); 1185 1188 } 1186 1189
Note: See TracChangeset
for help on using the changeset viewer.