]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-plugin-install-list-table.php
WordPress 4.1.2-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-plugin-install-list-table.php
index 1252227ed81f8f5e6cc1e1bbe263cc7713497958..07bfa0c7234178ef9ff085c22c0ce1f9a0578b48 100644 (file)
@@ -64,6 +64,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                        $tabs['search'] = __( 'Search Results' );
                $tabs['featured']  = _x( 'Featured', 'Plugin Installer' );
                $tabs['popular']   = _x( 'Popular', 'Plugin Installer' );
+               $tabs['recommended']   = _x( 'Recommended', 'Plugin Installer' );
                $tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
                if ( $tab === 'beta' || false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
                        $tabs['beta']      = _x( 'Beta Testing', 'Plugin Installer' );
@@ -134,6 +135,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                        case 'popular':
                        case 'new':
                        case 'beta':
+                       case 'recommended':
                                $args['browse'] = $tab;
                                break;
 
@@ -156,7 +158,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                /**
                 * Filter API request arguments for each Plugin Install screen tab.
                 *
-                * The dynamic portion of the hook name, $tab, refers to the plugin install tabs.
+                * The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
                 * Default tabs are 'dashboard', 'search', 'upload', 'featured', 'popular', 'new',
                 * and 'favorites'.
                 *
@@ -268,12 +270,17 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                $this->display_tablenav( 'bottom' );
        }
 
+       /**
+        * @param string $which
+        */
        protected function display_tablenav( $which ) {
                if ( $GLOBALS['tab'] === 'featured' ) {
                        return;
                }
 
-               if ( 'top' ==  $which ) { ?>
+               if ( 'top' ==  $which ) {
+                       wp_referer_field();
+               ?>
                        <div class="tablenav top">
                                <div class="alignleft actions">
                                        <?php
@@ -304,6 +311,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                return array();
        }
 
+       /**
+        * @param object $plugin_a
+        * @param object $plugin_b
+        * @return int
+        */
        private function order_callback( $plugin_a, $plugin_b ) {
                $orderby = $this->orderby;
                if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
@@ -467,7 +479,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                                <div class="column-compatibility">
                                        <?php
                                        if ( ! empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
-                                               echo '<span class="compatibility-untested">' . __( '<strong>Untested</strong> with your version of WordPress' ) . '</span>';
+                                               echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
                                        } elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) {
                                                echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
                                        } else {