Changeset 14459
- Timestamp:
- 06/05/2025 10:17:20 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/inc/template-tags.php
r14390 r14459 651 651 echo '<div class="plugin-notice notice notice-warning notice-alt"><p>' . __( '<strong>Warning:</strong> Transferring a plugin is intended to be <em>permanent</em>. There is no way to get plugin ownership back without contacting the plugin team.', 'wporg-plugins' ) . '</p></div>'; 652 652 653 $users = []; 653 $disabled_users = []; 654 $users = []; 654 655 foreach ( Tools::get_plugin_committers( $post->post_name ) as $user_login ) { 655 656 $user = get_user_by( 'login', $user_login ); 656 657 if ( $user->ID != get_current_user_id() ) { 657 658 $users[] = $user; 659 660 // Mark users as disabled if they don't have 2FA enabled, as plugins can't be transferred to users without 2FA. 661 if ( class_exists( 'Two_Factor_Core' ) && ! \Two_Factor_Core::is_user_using_two_factor( $user->ID ) ) { 662 $disabled_users[ $user->ID ] = true; 663 } 658 664 } 659 665 } … … 661 667 echo '<div class="plugin-notice notice notice-error notice-alt"><p>' . __( 'To transfer a plugin, you must first add the new owner as a committer.', 'wporg-plugins' ) . '</p></div>'; 662 668 return; 669 } 670 671 // Users must have 2FA enabled to be able to transfer a plugin. 672 if ( $disabled_users ) { 673 echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . __( 'Only users with Two-Factor authentication enabled can be selected.', 'wporg-plugins' ) . '</p></div>'; 663 674 } 664 675 … … 669 680 foreach ( $users as $user ) { 670 681 printf( 671 '<option value="%d" >%s</option>' . "\n",682 '<option value="%d" %s>%s</option>' . "\n", 672 683 esc_attr( $user->ID ), 684 disabled( isset( $disabled_users[ $user->ID ] ), true, false ), 673 685 esc_html( $user->display_name . ' (' . $user->user_login . ')' ) 674 686 ); 675 687 } 676 688 echo '</select></p>'; 689 677 690 // Translators: %s is the plugin name, as defined by the plugin itself. 678 691 echo '<p class="wp-block-button is-small"><input class="wp-block-button__link" type="submit" value="' . esc_attr( sprintf( __( 'Please transfer %s.', 'wporg-plugins' ), get_the_title() ) ) . '" /></p>';
Note: See TracChangeset
for help on using the changeset viewer.