Changeset 48374
- Timestamp:
- 07/07/2020 01:41:30 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r48184 r48374 678 678 public function single_row( $item ) { 679 679 global $status, $page, $s, $totals; 680 static $plugin_id_attrs = array(); 680 681 681 682 list( $plugin_file, $plugin_data ) = $item; 682 683 683 $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); 684 $plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_data['Name'] ); 685 $plugin_id_attr = $plugin_slug; 686 687 // Ensure the ID attribute is unique. 688 $suffix = 2; 689 while ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) { 690 $plugin_id_attr = "$plugin_slug-$suffix"; 691 $suffix++; 692 } 693 694 $plugin_id_attrs[] = $plugin_id_attr; 684 695 685 696 $context = $status; … … 740 751 '<a href="%s" id="deactivate-%s" aria-label="%s">%s</a>', 741 752 wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), 742 esc_attr( $plugin_ slug),753 esc_attr( $plugin_id_attr ), 743 754 /* translators: %s: Plugin name. */ 744 755 esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), … … 751 762 '<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>', 752 763 wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), 753 esc_attr( $plugin_ slug),764 esc_attr( $plugin_id_attr ), 754 765 /* translators: %s: Plugin name. */ 755 766 esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ), … … 762 773 '<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', 763 774 wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), 764 esc_attr( $plugin_ slug),775 esc_attr( $plugin_id_attr ), 765 776 /* translators: %s: Plugin name. */ 766 777 esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), … … 783 794 '<a href="%s" id="deactivate-%s" aria-label="%s">%s</a>', 784 795 wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ), 785 esc_attr( $plugin_ slug),796 esc_attr( $plugin_id_attr ), 786 797 /* translators: %s: Plugin name. */ 787 798 esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ), … … 794 805 '<a href="%s" id="resume-%s" class="resume-link" aria-label="%s">%s</a>', 795 806 wp_nonce_url( 'plugins.php?action=resume&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'resume-plugin_' . $plugin_file ), 796 esc_attr( $plugin_ slug),807 esc_attr( $plugin_id_attr ), 797 808 /* translators: %s: Plugin name. */ 798 809 esc_attr( sprintf( _x( 'Resume %s', 'plugin' ), $plugin_data['Name'] ) ), … … 805 816 '<a href="%s" id="activate-%s" class="edit" aria-label="%s">%s</a>', 806 817 wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ), 807 esc_attr( $plugin_ slug),818 esc_attr( $plugin_id_attr ), 808 819 /* translators: %s: Plugin name. */ 809 820 esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ), … … 816 827 '<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', 817 828 wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), 818 esc_attr( $plugin_ slug),829 esc_attr( $plugin_id_attr ), 819 830 /* translators: %s: Plugin name. */ 820 831 esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ),
Note: See TracChangeset
for help on using the changeset viewer.