Making WordPress.org


Ignore:
Timestamp:
03/07/2017 02:48:20 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Theme: Introduce wporg_support_maybe_add_view_all() and simplify the logic in loop-posts.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/loop-posts.php

    r5053 r5107  
    77 * @subpackage Theme
    88 */
    9 
    10 $is_moderator_view = class_exists( '\WordPressdotorg\Forums\Moderators' )
    11                 && defined( '\WordPressdotorg\Forums\Moderators::VIEWS' )
    12                 && in_array( bbp_get_view_id(), \WordPressdotorg\Forums\Moderators::VIEWS );
    139
    1410?>
     
    2521                        <span class="bbp-header">
    2622                            <?php esc_html_e( 'Forum:', 'wporg-forums' ); ?>
    27                             <a class="bbp-forum-permalink" href="<?php
    28                                 $forum_url = bbp_get_forum_permalink( bbp_get_topic_forum_id() );
    29                                 if ( $is_moderator_view ) {
    30                                     $forum_url = add_query_arg( 'view', 'all', $forum_url );
    31                                 }
    32                                 echo esc_url( $forum_url );
    33                             ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a><br />
     23                            <a class="bbp-forum-permalink" href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a><br />
     24
    3425                            <?php esc_html_e( 'As the topic:', 'wporg-forums' ); ?>
    35                             <a class="bbp-topic-permalink" href="<?php
    36                                 $topic_url = bbp_get_topic_permalink( bbp_get_topic_id() );
    37                                 if ( $is_moderator_view ) {
    38                                     $topic_url = add_query_arg( 'view', 'all', $topic_url );
    39                                 }
    40                                 echo esc_url( $topic_url );
    41                             ?>"><?php bbp_topic_title( bbp_get_topic_id() ); ?></a>
     26                            <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_topic_id() ); ?></a>
    4227                        </span>
    4328                    </div><!-- .bbp-meta -->
     
    5338                        <span class="bbp-header">
    5439                            <?php esc_html_e( 'Forum:', 'wporg-forums' ); ?>
    55                             <a class="bbp-forum-permalink" href="<?php
    56                                 $forum_url = bbp_get_forum_permalink( bbp_get_reply_forum_id() );
    57                                 if ( $is_moderator_view ) {
    58                                     $forum_url = add_query_arg( 'view', 'all', $forum_url );
    59                                 }
    60                                 echo esc_url( $forum_url );
    61                             ?>"><?php bbp_forum_title( bbp_get_reply_forum_id() ); ?></a><br />
     40                            <a class="bbp-forum-permalink" href="<?php bbp_forum_permalink( bbp_get_reply_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_reply_forum_id() ); ?></a><br />
     41
    6242                            <?php esc_html_e( 'In reply to:', 'wporg-forums' ); ?>
    63                             <a class="bbp-topic-permalink" href="<?php
    64                                 $topic_url = bbp_get_topic_permalink( bbp_get_reply_topic_id() );
    65                                 if ( $is_moderator_view ) {
    66                                     $topic_url = add_query_arg( 'view', 'all', $topic_url );
    67                                 }
    68                                 echo esc_url( $topic_url );
    69                             ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
     43                            <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a>
    7044                        </span>
    7145                    </div><!-- .bbp-meta -->
Note: See TracChangeset for help on using the changeset viewer.