ACF_Updates::add_plugin()publicACF 5.5.10

add_plugin

Registeres a plugin for updates.

Метод класса: ACF_Updates{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$ACF_Updates = new ACF_Updates();
$ACF_Updates->add_plugin( $plugin );
$plugin(массив) (обязательный)
The plugin array.

Список изменений

С версии 5.5.10 Введена.

Код ACF_Updates::add_plugin() ACF 6.0.4

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;
	}
}