Making WordPress.org

Changeset 5080


Ignore:
Timestamp:
03/04/2017 03:56:33 AM (9 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Remove the notice for closed forums added in [4610].

The code is moving to wporg-support theme, for consistency with a similar notice for closed topics.

See #2353, #bb3076.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r5052 r5080  
    2929                remove_filter( 'bbp_make_clickable', 'bbp_make_mentions_clickable', 8 );
    3030                add_filter( 'bbp_make_clickable', array( $this, 'make_mentions_clickable' ), 8 );
    31 
    32                 // Add notice to reply forms for privileged users in closed forums.
    33                 add_action( 'bbp_template_notices', array( $this, 'closed_forum_notice_for_moderators' ), 1 );
    3431
    3532                // Fix login url links
     
    185182
    186183                return $matches[1] . $link;
    187         }
    188 
    189         /**
    190          * For closed forums, adds a notice to privileged users indicating that
    191          * though the reply form is available, the forum is closed.
    192          *
    193          * Otherwise, unless the topic itself is closed, there is no indication that
    194          * the reply form is only available because of their privileged capabilities.
    195          */
    196         public function closed_forum_notice_for_moderators() {
    197                 if (
    198                         is_single()
    199                         &&
    200                         bbp_current_user_can_access_create_reply_form()
    201                         &&
    202                         bbp_is_forum_closed( bbp_get_topic_forum_id() )
    203                         &&
    204                         ! bbp_is_reply_edit()
    205                 ) {
    206                         $err_msg = sprintf( esc_html__(
    207                                 'The forum ‘%s’ is closed to new topics and replies, however your posting capabilities still allow you to do so.',
    208                                 'wporg-forums'),
    209                                 bbp_get_forum_title( bbp_get_topic_forum_id() )
    210                         );
    211 
    212                         bbp_add_error( 'bbp_forum_is_closed', $err_msg, 'message' );
    213                 }
    214184        }
    215185
Note: See TracChangeset for help on using the changeset viewer.