diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php
index 7d2c0fde71..5c85804b18 100644
a
|
b
|
function install_plugin_information() { |
899 | 899 | echo '<a class="button button-primary right disabled">' . __( 'Latest Version Installed' ) . '</a>'; |
900 | 900 | break; |
901 | 901 | } |
| 902 | |
| 903 | $installed_plugin = get_plugins( '/' . $api->slug ); |
| 904 | $key = array_keys( $installed_plugin ); |
| 905 | // Use the first plugin regardless of the name. |
| 906 | // Could have issues for multiple plugins in one directory if they share different version numbers. |
| 907 | $key = reset( $key ); |
| 908 | |
| 909 | $plugin_file = $api->slug . '/' . $key; |
| 910 | |
| 911 | if ( is_network_admin() ) { |
| 912 | $is_active = is_plugin_active_for_network( $plugin_file ); |
| 913 | } else { |
| 914 | $is_active = is_plugin_active( $plugin_file ); |
| 915 | } |
| 916 | |
| 917 | if ( !$is_active ) { |
| 918 | echo sprintf( |
| 919 | '<a href="%s" id="activate-%s" style="margin-right: 6px" class="button button-primary right" aria-label="%s" target="_parent">%s</a>', |
| 920 | wp_nonce_url('plugins.php?action=activate&plugin=' . urlencode($plugin_file) . '&plugin_status=' . $status['status'] . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file), |
| 921 | esc_attr($api->slug), |
| 922 | /* translators: %s: Plugin name. */ |
| 923 | esc_attr(sprintf(_x('Activate %s', 'plugin'), $api->name)), |
| 924 | __('Activate') |
| 925 | ); |
| 926 | } |
902 | 927 | } |
903 | 928 | echo "</div>\n"; |
904 | 929 | |