wp/wp-admin/includes/class-wp-plugins-list-table.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Plugins List Table class.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @subpackage List_Table
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @access private
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
class WP_Plugins_List_Table extends WP_List_Table {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    12
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    13
	 * Constructor.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    14
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    15
	 * @since 3.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    16
	 * @access public
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    18
	 * @see WP_List_Table::__construct() for more information on default arguments.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    19
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    20
	 * @param array $args An associative array of arguments.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    21
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    22
	public function __construct( $args = array() ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
		global $status, $page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		parent::__construct( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
			'plural' => 'plugins',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
			'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
		) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		$status = 'all';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
		if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search' ) ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
			$status = $_REQUEST['plugin_status'];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
		if ( isset($_REQUEST['s']) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
			$_SERVER['REQUEST_URI'] = add_query_arg('s', wp_unslash($_REQUEST['s']) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
		$page = $this->get_pagenum();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    40
	protected function get_table_classes() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
		return array( 'widefat', $this->_args['plural'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    44
	public function ajax_user_can() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
		return current_user_can('activate_plugins');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
	public function prepare_items() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
		global $status, $plugins, $totals, $page, $orderby, $order, $s;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
		wp_reset_vars( array( 'orderby', 'order', 's' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    53
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    54
		 * Filter the full array of plugins to list in the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    55
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
		 * @since 3.0.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    57
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    58
		 * @see get_plugins()
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    59
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    60
		 * @param array $plugins An array of plugins to display in the list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    61
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
		$plugins = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
			'all' => apply_filters( 'all_plugins', get_plugins() ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
			'search' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
			'active' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
			'inactive' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
			'recently_activated' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
			'upgrade' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
			'mustuse' => array(),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
			'dropins' => array()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
		$screen = $this->screen;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
		if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    76
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    77
			/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    78
			 * Filter whether to display the advanced plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    79
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    80
			 * There are two types of advanced plugins - must-use and drop-ins -
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    81
			 * which can be used in a single site or Multisite network.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    82
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    83
			 * The $type parameter allows you to differentiate between the type of advanced
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    84
			 * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    85
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    86
			 * @since 3.0.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    87
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    88
			 * @param bool   $show Whether to show the advanced plugins for the specified
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
			 *                     plugin type. Default true.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    90
			 * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    91
			 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    92
			if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
				$plugins['mustuse'] = get_mu_plugins();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    94
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    95
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    96
			/** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
			if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
				$plugins['dropins'] = get_dropins();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
			if ( current_user_can( 'update_plugins' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
				$current = get_site_transient( 'update_plugins' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
				foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
					if ( isset( $current->response[ $plugin_file ] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
						$plugins['all'][ $plugin_file ]['update'] = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
						$plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
		set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
		if ( ! $screen->in_admin( 'network' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
			$recently_activated = get_option( 'recently_activated', array() );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
			foreach ( $recently_activated as $key => $time )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
				if ( $time + WEEK_IN_SECONDS < time() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
					unset( $recently_activated[$key] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
			update_option( 'recently_activated', $recently_activated );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   122
		$plugin_info = get_site_transient( 'update_plugins' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   123
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
		foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   125
			// Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   126
			if ( isset( $plugin_info->response[ $plugin_file ] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   127
				$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   128
				// Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   129
				if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   130
					$plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   131
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   132
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   133
			} elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   134
				$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   135
				// Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   136
				if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   137
					$plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   138
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   139
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   140
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
			// Filter into individual sections
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   142
			if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   143
				// On the non-network screen, filter out network-only plugins as long as they're not individually activated
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
				unset( $plugins['all'][ $plugin_file ] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
			} elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   146
				// On the non-network screen, filter out network activated plugins
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
				unset( $plugins['all'][ $plugin_file ] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
			} elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
				|| ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   150
				// On the non-network screen, populate the active list with plugins that are individually activated
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   151
				// On the network-admin screen, populate the active list with plugins that are network activated
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
				$plugins['active'][ $plugin_file ] = $plugin_data;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
			} else {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   154
				if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   155
					// On the non-network screen, populate the recently activated list with plugins that have been recently activated
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
					$plugins['recently_activated'][ $plugin_file ] = $plugin_data;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   157
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   158
				// Populate the inactive list with plugins that aren't activated
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
				$plugins['inactive'][ $plugin_file ] = $plugin_data;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
		if ( $s ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
			$status = 'search';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
			$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
		$totals = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
		foreach ( $plugins as $type => $list )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
			$totals[ $type ] = count( $list );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
		if ( empty( $plugins[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
			$status = 'all';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
		$this->items = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
		foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
			// Translate, Don't Apply Markup, Sanitize HTML
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
			$this->items[$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
		$total_this_page = $totals[ $status ];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
		if ( $orderby ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
			$orderby = ucfirst( $orderby );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
			$order = strtoupper( $order );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
			uasort( $this->items, array( $this, '_order_callback' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
		$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
		$start = ( $page - 1 ) * $plugins_per_page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
		if ( $total_this_page > $plugins_per_page )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
			$this->items = array_slice( $this->items, $start, $plugins_per_page );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
		$this->set_pagination_args( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
			'total_items' => $total_this_page,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
			'per_page' => $plugins_per_page,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
		) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   203
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   204
	 * @staticvar string $term
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   205
	 * @param array $plugin
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   206
	 * @return boolean
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   207
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   208
	public function _search_callback( $plugin ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
		static $term;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
		if ( is_null( $term ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
			$term = wp_unslash( $_REQUEST['s'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   213
		foreach ( $plugin as $value ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   214
			if ( false !== stripos( strip_tags( $value ), $term ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
				return true;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   216
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   217
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
		return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   222
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   223
	 * @global string $orderby
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   224
	 * @global string $order
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   225
	 * @param array $plugin_a
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   226
	 * @param array $plugin_b
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   227
	 * @return int
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   228
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   229
	public function _order_callback( $plugin_a, $plugin_b ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
		global $orderby, $order;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
		$a = $plugin_a[$orderby];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
		$b = $plugin_b[$orderby];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
		if ( $a == $b )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
			return 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
		if ( 'DESC' == $order )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
			return ( $a < $b ) ? 1 : -1;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
		else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
			return ( $a < $b ) ? -1 : 1;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   244
	public function no_items() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
		global $plugins;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   247
		if ( !empty( $plugins['all'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
			_e( 'No plugins found.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   249
		else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
			_e( 'You do not appear to have any plugins available at this time.' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   251
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   253
	public function get_columns() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
		global $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
		return array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
			'cb'          => !in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
			'name'        => __( 'Plugin' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
			'description' => __( 'Description' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   263
	protected function get_sortable_columns() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
		return array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   266
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   267
	protected function get_views() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
		global $totals, $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
		$status_links = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
		foreach ( $totals as $type => $count ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   272
			if ( !$count )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   273
				continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   274
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   275
			switch ( $type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   276
				case 'all':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   277
					$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   278
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   279
				case 'active':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   280
					$text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
				case 'recently_activated':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   283
					$text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   284
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   285
				case 'inactive':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
					$text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   288
				case 'mustuse':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   289
					$text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   290
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   291
				case 'dropins':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   292
					$text = _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   293
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   294
				case 'upgrade':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   295
					$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   296
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   297
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   298
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   299
			if ( 'search' != $type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   300
				$status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   301
					add_query_arg('plugin_status', $type, 'plugins.php'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   302
					( $type == $status ) ? ' class="current"' : '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   303
					sprintf( $text, number_format_i18n( $count ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
					);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
		return $status_links;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   310
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   311
	protected function get_bulk_actions() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   312
		global $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
		$actions = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
		if ( 'active' != $status )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   317
			$actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
		if ( 'inactive' != $status && 'recent' != $status )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   320
			$actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
		if ( !is_multisite() || $this->screen->in_admin( 'network' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
			if ( current_user_can( 'update_plugins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
				$actions['update-selected'] = __( 'Update' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
			if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
				$actions['delete-selected'] = __( 'Delete' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
		return $actions;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   330
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   331
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   332
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   333
	 * @global string $status
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   334
	 * @param string $which
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   335
	 * @return null
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   336
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   337
	public function bulk_actions( $which = '' ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   338
		global $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   339
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
		if ( in_array( $status, array( 'mustuse', 'dropins' ) ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   341
			return;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   342
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   343
		parent::bulk_actions( $which );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   344
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   345
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   346
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   347
	 * @global string $status
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   348
	 * @param string $which
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   349
	 * @return null
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   350
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   351
	protected function extra_tablenav( $which ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   352
		global $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   353
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   354
		if ( ! in_array($status, array('recently_activated', 'mustuse', 'dropins') ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   355
			return;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   356
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   357
		echo '<div class="alignleft actions">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   358
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   359
		if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   360
			submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   361
		elseif ( 'top' == $which && 'mustuse' == $status )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   362
			echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   363
		elseif ( 'top' == $which && 'dropins' == $status )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   364
			echo '<p>' . sprintf( __( 'Drop-ins are advanced plugins in the <code>%s</code> directory that replace WordPress functionality when present.' ), str_replace( ABSPATH, '', WP_CONTENT_DIR ) ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   365
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   366
		echo '</div>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   367
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   368
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   369
	public function current_action() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   370
		if ( isset($_POST['clear-recent-list']) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   371
			return 'clear-recent-list';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   372
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   373
		return parent::current_action();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   374
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   375
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   376
	public function display_rows() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   377
		global $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   378
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   379
		if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   380
			return;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   381
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   382
		foreach ( $this->items as $plugin_file => $plugin_data )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   383
			$this->single_row( array( $plugin_file, $plugin_data ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   384
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   385
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   386
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   387
	 * @global string $status
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   388
	 * @global int $page
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   389
	 * @global string $s
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   390
	 * @global array $totals
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   391
	 * @param array $item
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   392
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   393
	public function single_row( $item ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   394
		global $status, $page, $s, $totals;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   395
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   396
		list( $plugin_file, $plugin_data ) = $item;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   397
		$context = $status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   398
		$screen = $this->screen;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   399
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   400
		// Pre-order.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   401
		$actions = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   402
			'deactivate' => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   403
			'activate' => '',
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   404
			'details' => '',
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   405
			'edit' => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   406
			'delete' => '',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   407
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   408
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   409
		if ( 'mustuse' == $context ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   410
			$is_active = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   411
		} elseif ( 'dropins' == $context ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   412
			$dropins = _get_dropins();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   413
			$plugin_name = $plugin_file;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   414
			if ( $plugin_file != $plugin_data['Name'] )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   415
				$plugin_name .= '<br/>' . $plugin_data['Name'];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   416
			if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   417
				$is_active = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   418
				$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   419
			} elseif ( defined( $dropins[ $plugin_file ][1] ) && constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   420
				$is_active = true;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   421
				$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   422
			} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   423
				$is_active = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   424
				$description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   425
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   426
			if ( $plugin_data['Description'] )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   427
				$description .= '<p>' . $plugin_data['Description'] . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   428
		} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   429
			if ( $screen->in_admin( 'network' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   430
				$is_active = is_plugin_active_for_network( $plugin_file );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   431
			else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   432
				$is_active = is_plugin_active( $plugin_file );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   433
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   434
			if ( $screen->in_admin( 'network' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   435
				if ( $is_active ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   436
					if ( current_user_can( 'manage_network_plugins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   437
						$actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   438
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   439
					if ( current_user_can( 'manage_network_plugins' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   440
						$actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   441
					if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   442
						$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   443
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   444
			} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   445
				if ( $is_active ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   446
					$actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   447
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   448
					$actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   449
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   450
					if ( ! is_multisite() && current_user_can('delete_plugins') )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   451
						$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   452
				} // end if $is_active
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   453
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   454
			 } // end if $screen->in_admin( 'network' )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   455
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   456
			if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   457
				$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   458
		} // end if $context
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   459
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   460
		$prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   461
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   462
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   463
		 * Filter the action links displayed for each plugin in the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   464
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   465
		 * The dynamic portion of the hook name, `$prefix`, refers to the context the
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   466
		 * action links are displayed in. The 'network_admin_' prefix is used if the
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   467
		 * current screen is the Network plugins list table. The prefix is empty ('')
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   468
		 * if the current screen is the site plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   469
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   470
		 * The default action links for the Network plugins list table include
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   471
		 * 'Network Activate', 'Network Deactivate', 'Edit', and 'Delete'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   472
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   473
		 * The default action links for the site plugins list table include
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   474
		 * 'Activate', 'Deactivate', and 'Edit', for a network site, and
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   475
		 * 'Activate', 'Deactivate', 'Edit', and 'Delete' for a single site.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   476
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   477
		 * @since 2.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   478
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   479
		 * @param array  $actions     An array of plugin action links.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   480
		 * @param string $plugin_file Path to the plugin file.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   481
		 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   482
		 * @param string $context     The plugin context. Defaults are 'All', 'Active',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   483
		 *                            'Inactive', 'Recently Activated', 'Upgrade',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   484
		 *                            'Must-Use', 'Drop-ins', 'Search'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   485
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   486
		$actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   487
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   488
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   489
		 * Filter the list of action links displayed for a specific plugin.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   490
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   491
		 * The first dynamic portion of the hook name, $prefix, refers to the context
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   492
		 * the action links are displayed in. The 'network_admin_' prefix is used if the
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   493
		 * current screen is the Network plugins list table. The prefix is empty ('')
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   494
		 * if the current screen is the site plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   495
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   496
		 * The second dynamic portion of the hook name, $plugin_file, refers to the path
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   497
		 * to the plugin file, relative to the plugins directory.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   498
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   499
		 * @since 2.7.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   500
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   501
		 * @param array  $actions     An array of plugin action links.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   502
		 * @param string $plugin_file Path to the plugin file.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   503
		 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   504
		 * @param string $context     The plugin context. Defaults are 'All', 'Active',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   505
		 *                            'Inactive', 'Recently Activated', 'Upgrade',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   506
		 *                            'Must-Use', 'Drop-ins', 'Search'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   507
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   508
		$actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   509
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   510
		$class = $is_active ? 'active' : 'inactive';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   511
		$checkbox_id =  "checkbox_" . md5($plugin_data['Name']);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   512
		if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   513
			$checkbox = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   514
		} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   515
			$checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . "</label>"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   516
				. "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' />";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   517
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   518
		if ( 'dropins' != $context ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   519
			$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   520
			$plugin_name = $plugin_data['Name'];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   521
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   522
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   523
		$id = sanitize_title( $plugin_name );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   524
		if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   525
			$class .= ' update';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   526
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   527
		$plugin_slug = ( isset( $plugin_data['slug'] ) ) ? $plugin_data['slug'] : '';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   528
		printf( "<tr id='%s' class='%s' data-slug='%s'>",
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   529
			$id,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   530
			$class,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   531
			$plugin_slug
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   532
		);
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   533
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   534
		list( $columns, $hidden ) = $this->get_column_info();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   535
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   536
		foreach ( $columns as $column_name => $column_display_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   537
			$style = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   538
			if ( in_array( $column_name, $hidden ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   539
				$style = ' style="display:none;"';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   540
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   541
			switch ( $column_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   542
				case 'cb':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   543
					echo "<th scope='row' class='check-column'>$checkbox</th>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   544
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   545
				case 'name':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   546
					echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   547
					echo $this->row_actions( $actions, true );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   548
					echo "</td>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   549
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   550
				case 'description':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   551
					echo "<td class='column-description desc'$style>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   552
						<div class='plugin-description'>$description</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   553
						<div class='$class second plugin-version-author-uri'>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   554
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   555
					$plugin_meta = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   556
					if ( !empty( $plugin_data['Version'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   557
						$plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   558
					if ( !empty( $plugin_data['Author'] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   559
						$author = $plugin_data['Author'];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   560
						if ( !empty( $plugin_data['AuthorURI'] ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   561
							$author = '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   562
						$plugin_meta[] = sprintf( __( 'By %s' ), $author );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   563
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   564
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   565
					// Details link using API info, if available
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   566
					if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   567
						$plugin_meta[] = sprintf( '<a href="%s" class="thickbox" aria-label="%s" data-title="%s">%s</a>',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   568
							esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   569
								'&TB_iframe=true&width=600&height=550' ) ),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   570
							esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   571
							esc_attr( $plugin_name ),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   572
							__( 'View details' )
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   573
						);
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   574
					} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   575
						$plugin_meta[] = sprintf( '<a href="%s">%s</a>',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   576
							esc_url( $plugin_data['PluginURI'] ),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   577
							__( 'Visit plugin site' )
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   578
						);
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   579
					}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   580
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   581
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   582
					 * Filter the array of row meta for each plugin in the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   583
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   584
					 * @since 2.8.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   585
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   586
					 * @param array  $plugin_meta An array of the plugin's metadata,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   587
					 *                            including the version, author,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   588
					 *                            author URI, and plugin URI.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   589
					 * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   590
					 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   591
					 * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   592
					 *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   593
					 *                            'Drop-ins', 'Search'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   594
					 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   595
					$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   596
					echo implode( ' | ', $plugin_meta );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   597
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   598
					echo "</div></td>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   599
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   600
				default:
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   601
					echo "<td class='$column_name column-$column_name'$style>";
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   602
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   603
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   604
					 * Fires inside each custom column of the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   605
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   606
					 * @since 3.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   607
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   608
					 * @param string $column_name Name of the column.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   609
					 * @param string $plugin_file Path to the plugin file.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   610
					 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   611
					 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   612
					do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   613
					echo "</td>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   614
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   615
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   616
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   617
		echo "</tr>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   618
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   619
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   620
		 * Fires after each row in the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   621
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   622
		 * @since 2.3.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   623
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   624
		 * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   625
		 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   626
		 * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   627
		 *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   628
		 *                            'Drop-ins', 'Search'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   629
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   630
		do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   631
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   632
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   633
		 * Fires after each specific row in the Plugins list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   634
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   635
		 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   636
		 * to the plugin file, relative to the plugins directory.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   637
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   638
		 * @since 2.7.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   639
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   640
		 * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   641
		 * @param array  $plugin_data An array of plugin data.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   642
		 * @param string $status      Status of the plugin. Defaults are 'All', 'Active',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   643
		 *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   644
		 *                            'Drop-ins', 'Search'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   645
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   646
		do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   647
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   648
}