194
* Filter API request arguments for each Plugin Install screen tab.
194
* Filters API request arguments for each Plugin Install screen tab.
196
196
* The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
197
197
* Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'.
461
461
/* translators: 1: Plugin name and version. */
462
462
$action_links[] = '<a class="install-now button" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Install Now' ) . '</a>';
466
466
case 'update_available':
467
467
if ( $status['url'] ) {
468
468
/* translators: 1: Plugin name and version */
469
469
$action_links[] = '<a class="update-now button aria-button-if-js" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now' ) . '</a>';
473
473
case 'latest_installed':
474
474
case 'newer_installed':
475
$action_links[] = '<span class="button button-disabled">' . _x( 'Installed', 'plugin' ) . '</span>';
475
if ( is_plugin_active( $status['file'] ) ) {
476
$action_links[] = '<button type="button" class="button button-disabled" disabled="disabled">' . _x( 'Active', 'plugin' ) . '</button>';
477
} elseif ( current_user_can( 'activate_plugins' ) ) {
478
$button_text = __( 'Activate' );
479
/* translators: %s: Plugin name */
480
$button_label = _x( 'Activate %s', 'plugin' );
481
$activate_url = add_query_arg( array(
482
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
483
'action' => 'activate',
484
'plugin' => $status['file'],
485
), network_admin_url( 'plugins.php' ) );
487
if ( is_network_admin() ) {
488
$button_text = __( 'Network Activate' );
489
/* translators: %s: Plugin name */
490
$button_label = _x( 'Network Activate %s', 'plugin' );
491
$activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
494
$action_links[] = sprintf(
495
'<a href="%1$s" class="button activate-now button-secondary" aria-label="%2$s">%3$s</a>',
496
esc_url( $activate_url ),
497
esc_attr( sprintf( $button_label, $plugin['name'] ) ),
501
$action_links[] = '<button type="button" class="button button-disabled" disabled="disabled">' . _x( 'Installed', 'plugin' ) . '</button>';