Making WordPress.org


Ignore:
Timestamp:
09/24/2016 06:16:41 AM (7 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.