Changeset 12802
- Timestamp:
- 08/03/2023 02:13:10 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
r12795 r12802 5 5 class Moderators { 6 6 7 const ARCHIVED = 'archived'; 8 const ARCHIVED_META = '_wporg_bbp_unarchived_post_status'; 9 const MODERATOR_META = '_wporg_bbp_moderator'; 10 const DEFAULT_STATUS = 'publish'; 11 const VIEWS = array( 'archived', 'pending', 'spam' ); 7 const ARCHIVED = 'archived'; 8 const ARCHIVED_META = '_wporg_bbp_unarchived_post_status'; 9 const MODERATOR_META = '_wporg_bbp_moderator'; 10 const MODERATOR_REPLY_AUTHOR = '_wporg_bbp_moderator_reply_author'; 11 const DEFAULT_STATUS = 'publish'; 12 const VIEWS = array( 'archived', 'pending', 'spam' ); 12 13 13 14 public function __construct() { … … 1158 1159 // Record the real user in the post meta. 1159 1160 $post_data['meta_input'] ??= []; 1160 $post_data['meta_input'][ self::MODERATOR_ META] = get_current_user_id();1161 $post_data['meta_input'][ self::MODERATOR_REPLY_AUTHOR ] = get_current_user_id(); 1161 1162 1162 1163 return $post_data; … … 1176 1177 } 1177 1178 1178 $user = get_user_by( 'id', get_post_meta( bbp_get_reply_id(), self::MODERATOR_ META, true ) );1179 $user = get_user_by( 'id', get_post_meta( bbp_get_reply_id(), self::MODERATOR_REPLY_AUTHOR, true ) ); 1179 1180 1180 1181 printf( … … 1187 1188 /** 1188 1189 * Pretend the @moderator user can moderate, except when they're logged in. 1190 * 1191 * This keeps the moderator account as a low-access account, while also showing the replies 1192 * with a moderator badge. This should probably ideally be a filter on the badges. 1189 1193 */ 1190 1194 public function anon_moderator_user_has_cap( $allcaps, $caps, $args, $user ) {
Note: See TracChangeset
for help on using the changeset viewer.