Changeset 4610 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
- Timestamp:
- 01/05/2017 11:16:27 PM (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
r4330 r4610 22 22 add_filter( 'embed_oembed_discover', '__return_false' ); 23 23 24 // Disable inline terms and mentions. 24 25 add_action( 'plugins_loaded', array( $this, 'disable_inline_terms' ) ); 26 27 // Add notice to reply forms for privileged users in closed forums. 28 add_action( 'bbp_template_notices', array( $this, 'closed_forum_notice_for_moderators' ), 1 ); 25 29 } 26 30 … … 91 95 } 92 96 97 /** 98 * For closed forums, adds a notice to privileged users indicating that 99 * though the reply form is available, the forum is closed. 100 * 101 * Otherwise, unless the topic itself is closed, there is no indication that 102 * the reply form is only available because of their privileged capabilities. 103 */ 104 public function closed_forum_notice_for_moderators() { 105 if ( 106 is_single() 107 && 108 bbp_current_user_can_access_create_reply_form() 109 && 110 bbp_is_forum_closed( bbp_get_topic_forum_id() ) 111 && 112 ! bbp_is_reply_edit() 113 ) { 114 $err_msg = sprintf( esc_html__( 115 'The forum ‘%s’ is closed to new topics and replies, however your posting capabilities still allow you to do so.', 116 'wporg-forums'), 117 bbp_get_forum_title( bbp_get_topic_forum_id() ) 118 ); 119 120 bbp_add_error( 'bbp_forum_is_closed', $err_msg, 'message' ); 121 } 122 } 93 123 94 124 }
Note: See TracChangeset
for help on using the changeset viewer.