WordPress.org

Making WordPress.org

Changeset 4126


Ignore:
Timestamp:
09/24/2016 06:16:41 AM (4 years ago)
Author:
netweb
Message:

Forums Theme: Use bbp_get_topic_id() in the current_user_can() check for displaying IP addresses for moderators.

This changeset is a follow up to [4124] which originally used bbp_topic_id() that was echo'ing the topic ID to the single-topic-lead.php template.

See #1967.

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

Legend:

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

    r4124 r4126  
    2828                <p class="bbp-topic-post-date"><a href="<?php bbp_topic_permalink(); ?>" title="#<?php bbp_topic_id(); ?>" class="bbp-topic-permalink"><?php bbp_topic_post_date( bbp_get_topic_id(), true ); ?></a></p>
    2929
    30                 <?php if ( current_user_can( 'moderate', bbp_topic_id() ) ) : ?>
     30                <?php if ( current_user_can( 'moderate', bbp_get_topic_id() ) ) : ?>
    3131
    3232                    <?php do_action( 'bbp_theme_before_topic_author_admin_details' ); ?>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/functions.php

    r4100 r4126  
    181181    /* translators: registration date format, see https://secure.php.net/date */
    182182    return mysql2date( __( 'F jS, Y', 'wporg-forums' ), $user->user_registered );
     183}
     184
     185/**
     186 * Check if the current page is a single review.
     187 */
     188function wporg_support_is_single_review() {
     189    if ( ! class_exists( 'WordPressdotorg\Forums\Plugin' ) || ! bbp_is_single_topic() ) {
     190        return false;
     191    }
     192
     193    return ( WordPressdotorg\Forums\Plugin::REVIEWS_FORUM_ID == bbp_get_topic_forum_id() );
    183194}
    184195
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/sidebar.php

    r4099 r4126  
    3939
    4040            <div>
    41                 <h3><?php _e( 'Topic Info', 'wporg-forums' ); ?></h3>
     41                <?php if ( wporg_support_is_single_review() ) : ?>
     42                    <h3><?php _e( 'Review Info', 'wporg-forums' ); ?></h3>
     43                <?php else : ?>
     44                    <h3><?php _e( 'Topic Info', 'wporg-forums' ); ?></h3>
     45                <?php endif; ?>
     46
    4247                <ul class="topic-info">
    4348                    <?php bb_base_single_topic_description(); ?>
Note: See TracChangeset for help on using the changeset viewer.