diff --git a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-report-topic.php b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-report-topic.php
index 170ac0333..134f03f04 100644
a
|
b
|
class Report_Topic { |
9 | 9 | |
10 | 10 | add_action( 'set_object_terms', array( $this, 'detect_manual_modlook' ), 10, 6 ); |
11 | 11 | |
| 12 | // Only allow moderators to remove modlook tag. |
| 13 | add_action( 'pre_delete_term', array( $this, 'prevent_modlook_removal_non_moderator' ), 10, 2 ); |
| 14 | |
12 | 15 | add_action( 'init', array( $this, 'capture_topic_report' ) ); |
13 | 16 | } |
14 | 17 | |
… |
… |
class Report_Topic { |
85 | 88 | |
86 | 89 | } |
87 | 90 | |
| 91 | public function prevent_modlook_removal_non_moderator( $term_id, $taxonomy ) { |
| 92 | $term = get_term( $term_id, $taxonomy ); |
| 93 | if ( ( ! empty( $term->slug ) && 'modlook' === $term->slug && ! user_can( 'moderate', get_current_user_id() ) ) ) { |
| 94 | wp_die( __( 'You cannot remove the modlook tag.' ) ); |
| 95 | } |
| 96 | } |
| 97 | |
88 | 98 | public function capture_topic_report() { |
89 | 99 | // Do not process anything if the user is not logged in. |
90 | 100 | if ( ! is_user_logged_in() ) { |