Changeset 5080
- Timestamp:
- 03/04/2017 03:56:33 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r5052 r5080 29 29 remove_filter( 'bbp_make_clickable', 'bbp_make_mentions_clickable', 8 ); 30 30 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 );34 31 35 32 // Fix login url links … … 185 182 186 183 return $matches[1] . $link; 187 }188 189 /**190 * For closed forums, adds a notice to privileged users indicating that191 * though the reply form is available, the forum is closed.192 *193 * Otherwise, unless the topic itself is closed, there is no indication that194 * 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 }214 184 } 215 185
Note: See TracChangeset
for help on using the changeset viewer.