Changeset 29227
- Timestamp:
- 07/18/2014 08:49:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r29225 r29227 18 18 } 19 19 20 /** 21 * Return a list of slugs of installed plugins, if known. 22 * 23 * Uses the transient data from the updates API to determine the slugs of 24 * known installed plugins. This might be better elsewhere, perhaps even 25 * within get_plugins(). 26 * 27 * @since 4.0.0 28 */ 29 protected function get_installed_plugin_slugs() { 30 $slugs = array(); 31 32 $plugin_info = get_site_transient( 'update_plugins' ); 33 if ( isset( $plugin_info->no_update ) ) { 34 foreach ( $plugin_info->no_update as $plugin ) { 35 $slugs[] = $plugin->slug; 36 } 37 } 38 39 if ( isset( $plugin_info->response ) ) { 40 foreach ( $plugin_info->response as $plugin ) { 41 $slugs[] = $plugin->slug; 42 } 43 } 44 45 return $slugs; 46 } 47 20 48 public function prepare_items() { 21 49 include( ABSPATH . 'wp-admin/includes/plugin-install.php' ); … … 67 95 $tab = key( $tabs ); 68 96 69 $args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => array( 'last_updated' => true, 'downloaded' => true ) ); 97 $args = array( 98 'page' => $paged, 99 'per_page' => $per_page, 100 'fields' => array( 'last_updated' => true, 'downloaded' => true ), 101 // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results. 102 'locale' => get_locale(), 103 'installed_plugins' => $this->get_installed_plugin_slugs(), 104 ); 70 105 71 106 switch ( $tab ) {
Note: See TracChangeset
for help on using the changeset viewer.