Ticket #2584: 2584.patch
File 2584.patch, 5.2 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-user-moderation/inc/class-plugin.php
22 22 // Meta key to store moderator's username on flag/unflag actions. 23 23 const MODERATOR_META = '_wporg_bbp_moderator'; 24 24 25 // Meta key to store moderation date on flag/unflag actions. 26 const MODERATION_DATE_META = '_wporg_bbp_moderation_date'; 27 25 28 /** 26 29 * Always return the same instance of this plugin. 27 30 * … … 232 235 if ( ! $this->is_user_flagged( $user_id ) ) { 233 236 update_user_meta( $user_id, self::USER_META, true ); 234 237 update_user_meta( $user_id, self::MODERATOR_META, wp_get_current_user()->user_nicename ); 238 update_user_meta( $user_id, self::MODERATION_DATE_META, current_time( 'mysql' ) ); 235 239 } 236 240 do_action( 'wporg_bbp_flag_user', $user_id ); 237 241 … … 246 250 if ( $this->is_user_flagged( $user_id ) ) { 247 251 delete_user_meta( $user_id, self::USER_META ); 248 252 update_user_meta( $user_id, self::MODERATOR_META, wp_get_current_user()->user_nicename ); 253 update_user_meta( $user_id, self::MODERATION_DATE_META, current_time( 'mysql' ) ); 249 254 } 250 255 do_action( 'wporg_bbp_unflag_user', $user_id ); 251 256 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/user-profile.php
15 15 if ( current_user_can( 'moderate' ) && class_exists( 'WordPressdotorg\Forums\User_Moderation\Plugin' ) ) { 16 16 $is_user_flagged = WordPressdotorg\Forums\User_Moderation\Plugin::get_instance()->is_user_flagged( bbp_get_displayed_user_id() ); 17 17 $moderator = get_user_meta( bbp_get_displayed_user_id(), WordPressdotorg\Forums\User_Moderation\Plugin::MODERATOR_META, true ); 18 $moderation_date = get_user_meta( bbp_get_displayed_user_id(), WordPressdotorg\Forums\User_Moderation\Plugin::MODERATION_DATE_META, true ); 18 19 19 20 if ( $is_user_flagged ) { 20 if ( $moderator ) {21 if ( $moderator && $moderation_date ) { 21 22 $msg = sprintf( 23 /* translators: 1: linked moderator's username, 2: moderation date, 3: moderation time */ 24 __( 'This user has been flagged by %1$s on %2$s at %3$s.', 'wporg-forums' ), 25 sprintf( '<a href="%s">%s</a>', esc_url( home_url( "/users/$moderator/" ) ), $moderator ), 26 /* translators: localized date format, see https://secure.php.net/date */ 27 mysql2date( __( 'F j, Y', 'wporg-forums' ), $moderation_date ), 28 /* translators: localized time format, see https://secure.php.net/date */ 29 mysql2date( __( 'g:i a', 'wporg-forums' ), $moderation_date ) 30 ); 31 } elseif ( $moderator ) { 32 $msg = sprintf( 22 33 /* translators: %s: linked moderator's username */ 23 34 __( 'This user has been flagged by %s.', 'wporg-forums' ), 24 35 sprintf( '<a href="%s">%s</a>', esc_url( home_url( "/users/$moderator/" ) ), $moderator ) -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
309 309 if ( class_exists( 'WordPressdotorg\Forums\User_Moderation\Plugin' ) ) : 310 310 $is_user_flagged = WordPressdotorg\Forums\User_Moderation\Plugin::get_instance()->is_user_flagged( get_post()->post_author ); 311 311 $moderator = get_user_meta( get_post()->post_author, WordPressdotorg\Forums\User_Moderation\Plugin::MODERATOR_META, true ); 312 $moderation_date = get_user_meta( get_post()->post_author, WordPressdotorg\Forums\User_Moderation\Plugin::MODERATION_DATE_META, true ); 312 313 313 314 if ( $is_user_flagged ) { 314 if ( $moderator ) {315 if ( $moderator && $moderation_date ) { 315 316 $notices[] = sprintf( 317 /* translators: 1: linked moderator's username, 2: moderation date, 3: moderation time */ 318 __( 'This user has been flagged by %1$s on %2$s.', 'wporg-forums' ), 319 sprintf( '<a href="%s">%s</a>', esc_url( home_url( "/users/$moderator/" ) ), $moderator ), 320 /* translators: localized date format, see https://secure.php.net/date */ 321 mysql2date( __( 'F j, Y', 'wporg-forums' ), $moderation_date ), 322 /* translators: localized time format, see https://secure.php.net/date */ 323 mysql2date( __( 'g:i a', 'wporg-forums' ), $moderation_date ) 324 ); 325 } elseif ( $moderator ) { 326 $notices[] = sprintf( 316 327 /* translators: %s: linked moderator's username */ 317 328 __( 'This user has been flagged by %s.', 'wporg-forums' ), 318 329 sprintf( '<a href="%s">%s</a>', esc_url( home_url( "/users/$moderator/" ) ), $moderator )