Changeset 6528 for trunk/src/includes/forums/template.php
- Timestamp:
- 06/12/2017 05:29:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r6438 r6528 664 664 $parent_id = get_post_field( 'post_parent', $forum_id ); 665 665 666 // Meta-data fallback 667 if ( empty( $parent_id ) ) { 668 $parent_id = get_post_meta( $forum_id, '_bbp_forum_id', true ); 669 } 670 671 // Filter 672 if ( ! empty( $parent_id ) ) { 673 $parent_id = bbp_get_forum_id( $parent_id ); 674 } 675 666 676 // Filter & return 667 677 return (int) apply_filters( 'bbp_get_forum_parent_id', (int) $parent_id, $forum_id ); … … 2187 2197 if ( ! empty( $last_active ) ) { 2188 2198 2199 // Has replies 2189 2200 if ( ! empty( $reply_count ) ) { 2190 2191 if ( bbp_is_forum_category( $forum_id ) ) { 2192 $retstr = sprintf( esc_html__( 'This category contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since ); 2193 } else { 2194 $retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s, and was last updated by %3$s %4$s.', 'bbpress' ), $topic_text, $reply_text, $last_updated_by, $time_since ); 2195 } 2196 2201 $retstr = bbp_is_forum_category( $forum_id ) 2202 ? sprintf( esc_html__( 'This category has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $topic_text, $reply_text, $time_since, $last_updated_by ) 2203 : sprintf( esc_html__( 'This forum has %1$s, %2$s, and was last updated %3$s by %4$s.', 'bbpress' ), $topic_text, $reply_text, $time_since, $last_updated_by ); 2204 2205 // Only has topics 2197 2206 } else { 2198 2199 if ( bbp_is_forum_category( $forum_id ) ) { 2200 $retstr = sprintf( esc_html__( 'This category contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since ); 2201 } else { 2202 $retstr = sprintf( esc_html__( 'This forum contains %1$s, and was last updated by %2$s %3$s.', 'bbpress' ), $topic_text, $last_updated_by, $time_since ); 2203 } 2207 $retstr = bbp_is_forum_category( $forum_id ) 2208 ? sprintf( esc_html__( 'This category has %1$s, and was last updated %2$s by %3$s.', 'bbpress' ), $topic_text, $time_since, $last_updated_by ) 2209 : sprintf( esc_html__( 'This forum has %1$s, and was last updated %2$s by %3$s.', 'bbpress' ), $topic_text, $time_since, $last_updated_by ); 2204 2210 } 2205 2211 2206 // Forum has no last active data 2212 // Forum has no last active data (but does have topics & replies) 2213 } elseif ( ! empty( $reply_count ) ) { 2214 $retstr = bbp_is_forum_category( $forum_id ) 2215 ? sprintf( esc_html__( 'This category has %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ) 2216 : sprintf( esc_html__( 'This forum has %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ); 2217 2218 // Forum has no last active data or replies (but does have topics) 2219 } elseif ( ! empty( $topic_count ) ) { 2220 $retstr = bbp_is_forum_category( $forum_id ) 2221 ? sprintf( esc_html__( 'This category has %1$s.', 'bbpress' ), $topic_text ) 2222 : sprintf( esc_html__( 'This forum has %1$s.', 'bbpress' ), $topic_text ); 2223 2224 // Forum is empty 2207 2225 } else { 2208 2209 if ( ! empty( $reply_count ) ) { 2210 2211 if ( bbp_is_forum_category( $forum_id ) ) { 2212 $retstr = sprintf( esc_html__( 'This category contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ); 2213 } else { 2214 $retstr = sprintf( esc_html__( 'This forum contains %1$s and %2$s.', 'bbpress' ), $topic_text, $reply_text ); 2215 } 2216 2217 } else { 2218 2219 if ( ! empty( $topic_count ) ) { 2220 2221 if ( bbp_is_forum_category( $forum_id ) ) { 2222 $retstr = sprintf( esc_html__( 'This category contains %1$s.', 'bbpress' ), $topic_text ); 2223 } else { 2224 $retstr = sprintf( esc_html__( 'This forum contains %1$s.', 'bbpress' ), $topic_text ); 2225 } 2226 2227 } else { 2228 $retstr = esc_html__( 'This forum is empty.', 'bbpress' ); 2229 } 2230 } 2231 } 2232 2233 // Add feeds 2234 //$feed_links = ( ! empty( $r['feed'] ) ) ? bbp_get_forum_topics_feed_link ( $forum_id ) . bbp_get_forum_replies_feed_link( $forum_id ) : ''; 2226 $retstr = esc_html__( 'This forum is empty.', 'bbpress' ); 2227 } 2235 2228 2236 2229 // Add the 'view all' filter back
Note: See TracChangeset
for help on using the changeset viewer.