Changeset 6692 for trunk/src/includes/topics/template.php
- Timestamp:
- 09/13/2017 05:14:59 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r6683 r6692 2254 2254 */ 2255 2255 function bbp_get_topic_class( $topic_id = 0, $classes = array() ) { 2256 $bbp = bbpress(); 2257 $topic_id = bbp_get_topic_id( $topic_id ); 2258 $classes = array_filter( (array) $classes ); 2259 $count = isset( $bbp->topic_query->current_post ) 2256 $bbp = bbpress(); 2257 $topic_id = bbp_get_topic_id( $topic_id ); 2258 $forum_id = bbp_get_topic_forum_id( $topic_id ); 2259 $author_id = bbp_get_topic_author_id( $topic_id ); 2260 $classes = array_filter( (array) $classes ); 2261 $count = isset( $bbp->topic_query->current_post ) 2260 2262 ? (int) $bbp->topic_query->current_post 2261 2263 : 1; 2262 2264 2265 // Stripes 2266 $even_odd = ( $count % 2 ) 2267 ? 'even' 2268 : 'odd'; 2269 2270 // Forum moderator replied to topic 2271 $forum_moderator = ( bbp_is_user_forum_moderator( $author_id, $forum_id ) === $author_id ) 2272 ? 'forum-mod' 2273 : ''; 2274 2275 // Is this topic a sticky? 2276 $sticky = bbp_is_topic_sticky( $topic_id, false ) 2277 ? 'sticky' 2278 : ''; 2279 2280 // Is this topic a super-sticky? 2281 $super_sticky = bbp_is_topic_super_sticky( $topic_id ) 2282 ? 'super-sticky' 2283 : ''; 2284 2263 2285 // Get topic classes 2264 2286 $topic_classes = array( 2265 'loop-item-' . $count, 2266 ( $count % 2 ) ? 'even' : 'odd', 2267 bbp_is_topic_sticky( $topic_id, false ) ? 'sticky' : '', 2268 bbp_is_topic_super_sticky( $topic_id ) ? 'super-sticky' : '', 2269 'bbp-parent-forum-' . bbp_get_topic_forum_id( $topic_id ), 2270 'user-id-' . bbp_get_topic_author_id( $topic_id ) 2287 'loop-item-' . $count, 2288 'user-id-' . $author_id, 2289 'bbp-parent-forum-' . $forum_id, 2290 $even_odd, 2291 $forum_moderator, 2292 $sticky, 2293 $super_sticky 2271 2294 ); 2272 2295
Note: See TracChangeset
for help on using the changeset viewer.