Changeset 6384 for trunk/src/includes/topics/template.php
- Timestamp:
- 03/20/2017 10:44:00 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r6362 r6384 173 173 174 174 // What are the default allowed statuses (based on user caps) 175 if ( bbp_get_view_all( ) ) {175 if ( bbp_get_view_all( 'edit_others_topics' ) ) { 176 176 177 177 // Default view=all statuses … … 310 310 311 311 // What are the default allowed statuses (based on user caps) 312 if ( bbp_get_view_all( ) ) {312 if ( bbp_get_view_all( 'edit_others_topics' ) ) { 313 313 $sticky_query['post_status'] = $r['post_status']; 314 314 … … 900 900 } 901 901 902 // Maybe add view-all args 903 $add_args = bbp_get_view_all( 'edit_others_replies' ) 904 ? array( 'view' => 'all' ) 905 : false; 906 902 907 // Add pagination to query object 903 908 $pagination_links = paginate_links( array( … … 909 914 'mid_size' => 2, 910 915 'end_size' => 3, 911 'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false916 'add_args' => $add_args 912 917 ) ); 913 918 … … 1163 1168 1164 1169 /** 1170 * Return array of public topic statuses. 1171 * 1172 * @since 2.6.0 bbPress (r6383) 1173 * 1174 * @uses bbp_get_public_status_id() 1175 * @uses bbp_get_closed_status_id() 1176 * 1177 * @return array 1178 */ 1179 function bbp_get_public_topic_statuses() { 1180 $statuses = bbp_get_public_topic_statuses(); 1181 1182 return (array) apply_filters( 'bbp_get_public_topic_statuses', $statuses ); 1183 } 1184 1185 /** 1165 1186 * Is the topic closed to new replies? 1166 1187 * … … 1197 1218 1198 1219 /** 1199 * Is the topic not spam or deleted? 1220 * Is the topic publicly viewable? 1221 * 1222 * @since 2.6.0 bbPress (r6383) 1223 * 1224 * @param int $topic_id Optional. Topic id 1225 * @uses bbp_get_topic_id() To get the topic id 1226 * @uses bbp_get_topic_status() To get the topic status 1227 * @uses apply_filters() Calls 'bbp_is_topic_public' with the topic id 1228 * @return bool True if public, false if not. 1229 */ 1230 function bbp_is_topic_public( $topic_id = 0 ) { 1231 $topic_id = bbp_get_topic_id( $topic_id ); 1232 $status = bbp_get_topic_status( $topic_id ); 1233 $public = bbp_get_public_topic_statuses(); 1234 $is_public = in_array( $status, $public, true ); 1235 1236 return (bool) apply_filters( 'bbp_is_topic_public', (bool) $is_public, $topic_id ); 1237 } 1238 1239 /** 1240 * Does the topic have a published status? 1200 1241 * 1201 1242 * @since 2.0.0 bbPress (r3496) … … 2241 2282 2242 2283 // Hidden link 2243 $retval .= ! bbp_get_view_all( )2284 $retval .= ! bbp_get_view_all( 'edit_others_replies' ) 2244 2285 ? " <a href='" . esc_url( bbp_add_view_all( $link, true ) ) . "'>" . esc_html( $extra ) . "</a>" 2245 2286 : " {$extra}";
Note: See TracChangeset
for help on using the changeset viewer.