Making WordPress.org

Changeset 5086


Ignore:
Timestamp:
03/06/2017 12:39:04 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Theme: Show user's reviews as a custom view in their profile.

Fixes #2007.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support
Files:
1 added
3 edited

Legend:

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

    r5084 r5086  
    2121
    2222        <div id="bbp-user-body">
    23             <?php if ( bbp_is_favorites()               ) bbp_get_template_part( 'user', 'favorites'       ); ?>
    24             <?php if ( bbp_is_subscriptions()           ) bbp_get_template_part( 'user', 'subscriptions'   ); ?>
    25             <?php if ( bbp_is_single_user_engagements() ) bbp_get_template_part( 'user', 'engagements'     ); ?>
    26             <?php if ( bbp_is_single_user_topics()      ) bbp_get_template_part( 'user', 'topics-created'  ); ?>
    27             <?php if ( bbp_is_single_user_replies()     ) bbp_get_template_part( 'user', 'replies-created' ); ?>
    28             <?php if ( bbp_is_single_user_edit()        ) bbp_get_template_part( 'form', 'user-edit'       ); ?>
    29             <?php if ( bbp_is_single_user_profile()     ) bbp_get_template_part( 'user', 'profile'         ); ?>
     23            <?php if ( bbp_is_favorites()                     ) bbp_get_template_part( 'user', 'favorites'       ); ?>
     24            <?php if ( bbp_is_subscriptions()                 ) bbp_get_template_part( 'user', 'subscriptions'   ); ?>
     25            <?php if ( bbp_is_single_user_engagements()       ) bbp_get_template_part( 'user', 'engagements'     ); ?>
     26            <?php if ( bbp_is_single_user_topics()            ) bbp_get_template_part( 'user', 'topics-created'  ); ?>
     27            <?php if ( bbp_is_single_user_replies()           ) bbp_get_template_part( 'user', 'replies-created' ); ?>
     28            <?php if ( wporg_support_is_single_user_reviews() ) bbp_get_template_part( 'user', 'reviews-created' ); ?>
     29            <?php if ( bbp_is_single_user_edit()              ) bbp_get_template_part( 'form', 'user-edit'       ); ?>
     30            <?php if ( bbp_is_single_user_profile()           ) bbp_get_template_part( 'user', 'profile'         ); ?>
    3031        </div>
    3132    </div>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/user-details.php

    r5085 r5086  
    4747                        printf( esc_attr__( "%s's Replies Created", 'wporg-forums' ), bbp_get_displayed_user_field( 'display_name' ) );
    4848                    ?>"><?php esc_html_e( 'Replies Created', 'wporg-forums' ); ?></a>
     49                </span>
     50            </li>
     51
     52            <li class="<?php if ( wporg_support_is_single_user_reviews() ) :?>current<?php endif; ?>">
     53                <span class='bbp-user-replies-created-link'>
     54                    <a href="<?php bbp_user_profile_url(); ?>reviews/" title="<?php
     55                        /* translators: %s: user's display name */
     56                        printf( esc_attr__( "%s's Reviews", 'wporg-forums' ), bbp_get_displayed_user_field( 'display_name' ) );
     57                    ?>"><?php esc_html_e( 'Reviews', 'wporg-forums' ); ?></a>
    4958                </span>
    5059            </li>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r5079 r5086  
    225225
    226226    return ( WordPressdotorg\Forums\Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id() );
     227}
     228
     229/**
     230 * Check if the current page is a user's reviews page.
     231 *
     232 * @return bool True if the page is a user's reviews page, false otherwise.
     233 */
     234function wporg_support_is_single_user_reviews() {
     235    return get_query_var( 'wporg_single_user_reviews' );
    227236}
    228237
Note: See TracChangeset for help on using the changeset viewer.