~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/includes/class-wp-plugin-install-list-table.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:49:28 UTC
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: barry.price@canonical.com-20160817044928-viijiwb4tl8jwzmp
new upstream release 4.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                $nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item.
105
105
 
106
106
                /**
107
 
                 * Filter the tabs shown on the Plugin Install screen.
 
107
                 * Filters the tabs shown on the Plugin Install screen.
108
108
                 *
109
109
                 * @since 2.7.0
110
110
                 *
114
114
                $tabs = apply_filters( 'install_plugins_tabs', $tabs );
115
115
 
116
116
                /**
117
 
                 * Filter tabs not associated with a menu item on the Plugin Install screen.
 
117
                 * Filters tabs not associated with a menu item on the Plugin Install screen.
118
118
                 *
119
119
                 * @since 2.7.0
120
120
                 *
191
191
                }
192
192
 
193
193
                /**
194
 
                 * Filter API request arguments for each Plugin Install screen tab.
 
194
                 * Filters API request arguments for each Plugin Install screen tab.
195
195
                 *
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'.
285
285
                ?>
286
286
        </ul>
287
287
 
288
 
        <?php install_search_form( isset( $views['plugin-install-search'] ) ); ?>
 
288
        <?php install_search_form(); ?>
289
289
</div>
290
290
<?php
291
291
        }
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>';
463
463
                                                }
 
464
                                                break;
464
465
 
465
 
                                                break;
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>';
470
470
                                                }
 
471
                                                break;
471
472
 
472
 
                                                break;
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' ) );
 
486
 
 
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 );
 
492
                                                        }
 
493
 
 
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'] ) ),
 
498
                                                                $button_text
 
499
                                                        );
 
500
                                                } else {
 
501
                                                        $action_links[] = '<button type="button" class="button button-disabled" disabled="disabled">' . _x( 'Installed', 'plugin' ) . '</button>';
 
502
                                                }
476
503
                                                break;
477
504
                                }
478
505
                        }
494
521
                        }
495
522
 
496
523
                        /**
497
 
                         * Filter the install action links for a plugin.
 
524
                         * Filters the install action links for a plugin.
498
525
                         *
499
526
                         * @since 2.7.0
500
527
                         *