Ticket #2474: meta-2474.patch
File meta-2474.patch, 3.8 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
32 32 33 33 // Limit no-replies view to certain number of days. 34 34 add_filter( 'bbp_register_view_no_replies', array( $this, 'limit_no_replies_view' ) ); 35 36 // Store moderator's username on approve/unapprove actions. 37 add_action( 'bbp_approved_topic', array( $this, 'store_moderator_username' ) ); 38 add_action( 'bbp_approved_reply', array( $this, 'store_moderator_username' ) ); 39 add_action( 'bbp_unapproved_topic', array( $this, 'store_moderator_username' ) ); 40 add_action( 'bbp_unapproved_reply', array( $this, 'store_moderator_username' ) ); 35 41 } 36 42 37 43 /** … … 173 179 return $args; 174 180 } 175 181 182 /** 183 * Store moderator's username on approve/unapprove actions. 184 * 185 * @param int $post_id Post ID. 186 */ 187 public function store_moderator_username( $post_id ) { 188 update_post_meta( $post_id, '_wporg_bbp_moderator', wp_get_current_user()->user_login ); 189 } 190 176 191 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
6 6 7 7 const ARCHIVED = 'archived'; 8 8 const ARCHIVED_META = '_wporg_bbp_unarchived_post_status'; 9 const MODERATOR_META = '_wporg_bbp_moderator'; 9 10 const DEFAULT_STATUS = 'publish'; 10 11 const VIEWS = array( 'archived', 'pending', 'spam' ); 11 12 … … 248 249 ), true ); 249 250 if ( $post_id ) { 250 251 update_post_meta( $post->ID, self::ARCHIVED_META, $post->post_status ); 252 update_post_meta( $post->ID, self::MODERATOR_META, wp_get_current_user()->user_login ); 251 253 return true; 252 254 } 253 255 } … … 276 278 ) ); 277 279 if ( $post_id ) { 278 280 delete_post_meta( $post->ID, self::ARCHIVED_META ); 281 update_post_meta( $post->ID, self::MODERATOR_META, wp_get_current_user()->user_login ); 279 282 return true; 280 283 } 281 284 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
251 251 $notice = __( 'This post has been flagged as spam.', 'wporg-forums' ); 252 252 } 253 253 } elseif ( 'archived' === $post_status ) { 254 $notice = __( 'This post is currently archived.', 'wporg-forums' ); 254 $moderator = get_post_meta( get_the_ID(), '_wporg_bbp_moderator', true ); 255 256 if ( $moderator ) { 257 /* translators: %s: moderator's username */ 258 $notice = sprintf( __( 'This post has been archived by %s.', 'wporg-forums' ), $moderator ); 259 } else { 260 $notice = __( 'This post is currently archived.', 'wporg-forums' ); 261 } 255 262 } else { 256 $notice = __( 'This post is currently pending.', 'wporg-forums' ); 263 $moderator = get_post_meta( get_the_ID(), '_wporg_bbp_moderator', true ); 264 265 if ( $moderator ) { 266 /* translators: %s: moderator's username */ 267 $notice = sprintf( __( 'This post has been unapproved by %s.', 'wporg-forums' ), $moderator ); 268 } else { 269 $notice = __( 'This post is currently pending.', 'wporg-forums' ); 270 } 257 271 } 258 272 259 273 elseif ( in_array( $post_status, array( 'pending', 'spam' ) ) ) :