// Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
if ( isset( $plugin_info->response[ $plugin_file ] ) ) {
$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
+ // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
+ if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
+ $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
+ }
+
} elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {
$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
+ // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
+ if ( isset( $plugins['upgrade'][ $plugin_file ] ) ) {
+ $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
+ }
}
// Filter into individual sections
) );
}
+ /**
+ * @staticvar string $term
+ * @param array $plugin
+ * @return boolean
+ */
public function _search_callback( $plugin ) {
static $term;
if ( is_null( $term ) )
return false;
}
+ /**
+ * @global string $orderby
+ * @global string $order
+ * @param array $plugin_a
+ * @param array $plugin_b
+ * @return int
+ */
public function _order_callback( $plugin_a, $plugin_b ) {
global $orderby, $order;
return $actions;
}
+ /**
+ * @global string $status
+ * @param string $which
+ * @return null
+ */
public function bulk_actions( $which = '' ) {
global $status;
parent::bulk_actions( $which );
}
+ /**
+ * @global string $status
+ * @param string $which
+ * @return null
+ */
protected function extra_tablenav( $which ) {
global $status;
$this->single_row( array( $plugin_file, $plugin_data ) );
}
+ /**
+ * @global string $status
+ * @global int $page
+ * @global string $s
+ * @global array $totals
+ * @param array $item
+ */
public function single_row( $item ) {
global $status, $page, $s, $totals;
/**
* Filter the action links displayed for each plugin in the Plugins list table.
*
- * The dynamic portion of the hook name, $prefix, refers to the context the
+ * The dynamic portion of the hook name, `$prefix`, refers to the context the
* action links are displayed in. The 'network_admin_' prefix is used if the
* current screen is the Network plugins list table. The prefix is empty ('')
* if the current screen is the site plugins list table.
if ( ! empty( $totals['upgrade'] ) && ! empty( $plugin_data['update'] ) )
$class .= ' update';
- echo "<tr id='$id' class='$class'>";
+ $plugin_slug = ( isset( $plugin_data['slug'] ) ) ? $plugin_data['slug'] : '';
+ printf( "<tr id='%s' class='%s' data-slug='%s'>",
+ $id,
+ $class,
+ $plugin_slug
+ );
list( $columns, $hidden ) = $this->get_column_info();
/**
* Fires after each specific row in the Plugins list table.
*
- * The dynamic portion of the hook name, $plugin_file, refers to the path
+ * The dynamic portion of the hook name, `$plugin_file`, refers to the path
* to the plugin file, relative to the plugins directory.
*
* @since 2.7.0