Changeset 12813 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-release-confirmation.php
- Timestamp:
- 08/08/2023 05:14:08 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-release-confirmation.php
r12812 r12813 23 23 static function display() { 24 24 $plugins = Tools::get_users_write_access_plugins( wp_get_current_user() ); 25 26 if ( isset( $_GET['show-plugin'] ) && current_user_can( 'plugin_review' ) ) { 27 $plugins = [ wp_unslash( $_GET['show-plugin'] ) ]; 28 } 25 29 26 30 if ( ! $plugins ) { … … 186 190 if ( ! $data['confirmations_required'] ) { 187 191 _e( 'Release did not require confirmation.', 'wporg-plugins' ); 192 } else if ( ! empty( $data['discarded'] ) ) { 193 _e( 'Release discarded.', 'wporg-plugins' ); 188 194 } else if ( $data['confirmed'] ) { 189 195 _e( 'Release confirmed.', 'wporg-plugins' ); … … 223 229 ); 224 230 } 231 232 if ( ! empty( $data['discarded'] ) ) { 233 $user = get_user_by( 'slug', $data['discarded']['user'] ); 234 printf( 235 '<span title="%s">%s</span><br>', 236 esc_attr( gmdate( 'Y-m-d H:i:s', $time ) ), 237 sprintf( 238 __( 'Discarded by %1$s, %2$s ago.', 'wporg-plugins' ), 239 $user->display_name ?: $user->user_nicename, 240 human_time_diff( $data['discarded']['time'] ) 241 ) 242 ); 243 } 225 244 echo '</div>'; 226 245 … … 231 250 $buttons = []; 232 251 233 if ( $data['confirmations_required'] ) {252 if ( $data['confirmations_required'] && empty( $data['discarded'] ) ) { 234 253 $current_user_confirmed = isset( $data['confirmations'][ wp_get_current_user()->user_login ] ); 235 254 … … 244 263 __( 'Confirm', 'wporg-plugins' ) 245 264 ); 265 $buttons[] = sprintf( 266 '<a href="%s" class="button approve-release button-secondary">%s</a>', 267 Template::get_release_confirmation_link( $data['tag'], $plugin, 'discard' ), 268 __( 'Discard', 'wporg-plugins' ) 269 ); 246 270 } else { 247 271 $buttons[] = sprintf( 248 272 '<a class="button approve-release button-secondary disabled">%s</a>', 249 273 __( 'Confirm', 'wporg-plugins' ) 274 ); 275 $buttons[] = sprintf( 276 '<a class="button approve-release button-secondary disabled">%s</a>', 277 __( 'Discard', 'wporg-plugins' ) 250 278 ); 251 279 }
Note: See TracChangeset
for help on using the changeset viewer.