Plugins: Avoid ID attribute collisions in plugins list table.

Removes id attributes with non-unique plugin slug and adds a data attribute
with the unique plugin file.

Props khag7.
Fixes #18974.



git-svn-id: https://develop.svn.wordpress.org/trunk@36205 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland 2016-01-06 22:39:23 +00:00
parent 58b35571bb
commit c67abd1c66

View File

@ -695,15 +695,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
$plugin_name = $plugin_data['Name'];
}
$id = sanitize_title( $plugin_name );
if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) )
$class .= ' update';
$plugin_slug = ( isset( $plugin_data['slug'] ) ) ? $plugin_data['slug'] : '';
printf( "<tr id='%s' class='%s' data-slug='%s'>",
$id,
$class,
$plugin_slug
$plugin_slug = isset( $plugin_data['slug'] ) ? $plugin_data['slug'] : sanitize_title( $plugin_name );
printf( '<tr class="%s" data-slug="%s" data-plugin="%s">',
esc_attr( $class ),
esc_attr( $plugin_slug ),
esc_attr( $plugin_file )
);
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();