Changeset 8058 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
- Timestamp:
- 01/09/2019 06:03:27 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r7966 r8058 782 782 function bb_base_single_forum_description() { 783 783 784 // Validate forum_id785 $forum_id = bbp_get_forum_id();786 787 784 // Unhook the 'view all' query var adder 788 785 remove_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' ); 789 786 790 // Get some forum data 791 $topic_count = bbp_get_forum_topic_count( $forum_id, true, true ); 792 $reply_count = bbp_get_forum_reply_count( $forum_id, true, true ); 793 $last_active = bbp_get_forum_last_active_id( $forum_id ); 794 795 // Has replies 796 if ( !empty( $reply_count ) ) { 797 $reply_text = sprintf( _n( '%s reply', '%s replies', $reply_count, 'wporg-forums' ), bbp_number_format( $reply_count ) ); 798 } else { 799 $reply_text = ''; 800 } 801 802 // Forum has active data 803 if ( !empty( $last_active ) ) { 804 $topic_text = bbp_get_forum_topics_link( $forum_id ); 805 $time_since = bbp_get_forum_freshness_link( $forum_id ); 806 807 // Forum has no last active data 808 } else { 809 $topic_text = sprintf( _n( '%s topic', '%s topics', $topic_count, 'wporg-forums' ), bbp_number_format( $topic_count ) ); 810 } 811 ?> 812 813 <?php if ( bbp_get_forum_parent_id() ) : ?> 787 if ( bbp_get_forum_parent_id() ) : ?> 814 788 <li class="topic-parent"><?php 815 789 /* translators: %s: forum title */ … … 821 795 ); 822 796 ?></li> 823 <?php endif; ?>824 <?php //if ( !empty( $topic_count ) ) : ?>825 <!-- <li class="topic-count"><?php echo $topic_text; ?></li> -->826 <?php //endif; ?>827 <?php //if ( !empty( $reply_count ) ) : ?>828 <!-- <li class="reply-count"><?php echo $reply_text; ?></li> -->829 <?php //endif; ?>830 <?php //if ( !empty( $last_active ) ) : ?>831 <!-- <li class="forum-freshness-author"> --><?php832 /* translators: %s: post author link */833 //printf( __( 'Last post by: %s', 'wporg-forums' ),834 // bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_active ) )835 //);836 ?><!-- </li> -->837 <?php //endif; ?>838 <?php if ( !empty( $time_since ) ) : ?>839 <li class="forum-freshness-time"><?php840 /* translators: %s: date/time link to the latest post */841 printf( __( 'Last activity: %s', 'wporg-forums' ), $time_since );842 ?></li>843 797 <?php endif; 844 798 }
Note: See TracChangeset
for help on using the changeset viewer.