Plugin_Upgrader::plugin_info
Retrieves the path to the file that contains the plugin info.
This isn't used internally in the class, but is called by the skins.
Метод класса: Plugin_Upgrader{}
Хуков нет.
Возвращает
string|false. The full path to the main plugin file, or false.
Использование
$Plugin_Upgrader = new Plugin_Upgrader(); $Plugin_Upgrader->plugin_info();
Список изменений
| С версии 2.8.0 | Введена. |
Код Plugin_Upgrader::plugin_info() Plugin Upgrader::plugin info WP 7.1.3
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.
$plugin_files = array_keys( $plugin );
return $this->result['destination_name'] . '/' . $plugin_files[0];
}