ACF
Updater::add_plugin
Registeres a plugin for updates.
Метод класса: Updater{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Updater = new Updater(); $Updater->add_plugin( $plugin );
- $plugin(массив) (обязательный)
- The plugin array.
Список изменений
| С версии 5.5.10 | Введена. |
Код Updater::add_plugin() Updater::add plugin ACF 6.4.2
public function add_plugin( $plugin ) {
// validate.
$plugin = wp_parse_args(
$plugin,
array(
'id' => '',
'key' => '',
'slug' => '',
'basename' => '',
'version' => '',
)
);
// Check if is_plugin_active() function exists. This is required on the front end of the
// site, since it is in a file that is normally only loaded in the admin.
if ( ! function_exists( 'is_plugin_active' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// add if is active plugin (not included in theme).
if ( is_plugin_active( $plugin['basename'] ) ) {
$this->plugins[ $plugin['basename'] ] = $plugin;
}
}