Uses
Uses | Description |
---|---|
wp-admin/includes/plugin.php: get_plugins() | Check the plugins directory and retrieve all plugin files with plugin data. |
Retrieve the path to the file that contains the plugin info.
This isn’t used internally in the class, but is called by the skins.
(string|false) The full path to the main plugin file, or false.
File: wp-admin/includes/class-plugin-upgrader.php
public function plugin_info() { if ( ! is_array( $this->result ) ) { return false; } if ( empty( $this->result['destination_name'] ) ) { return false; } // Ensure to pass with leading slash. $plugin = get_plugins( '/' . $this->result['destination_name'] ); if ( empty( $plugin ) ) { return false; } // Assume the requested plugin is the first in the list. $pluginfiles = array_keys( $plugin ); return $this->result['destination_name'] . '/' . $pluginfiles[0]; }
Version | Description |
---|---|
2.8.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/plugin_upgrader/plugin_info