Packages
in package
Packages class.
Tags
Table of Contents
- $packages : array<string|int, mixed>
- Array of package names and their main package classes.
- init() : mixed
- Init the package loader.
- on_init() : mixed
- Callback for WordPress init hook.
- package_exists() : bool
- Checks a package exists by looking for it's directory.
- load_packages() : mixed
- Loads packages after plugins_loaded hook.
- missing_package() : mixed
- If a package is missing, add an admin notice.
- __construct() : mixed
- Static-only class.
Properties
$packages
Array of package names and their main package classes.
protected
static array<string|int, mixed>
$packages
= array('woocommerce-blocks' => '\Automattic\WooCommerce\Blocks\Package')
Methods
init()
Init the package loader.
public
static init() : mixed
Tags
Return values
mixed —on_init()
Callback for WordPress init hook.
public
static on_init() : mixed
Return values
mixed —package_exists()
Checks a package exists by looking for it's directory.
public
static package_exists(string $package) : bool
Parameters
- $package : string
-
Package name.
Return values
bool —load_packages()
Loads packages after plugins_loaded hook.
protected
static load_packages() : mixed
Each package should include an init file which loads the package so it can be used by core.
Return values
mixed —missing_package()
If a package is missing, add an admin notice.
protected
static missing_package(string $package) : mixed
Parameters
- $package : string
-
Package name.
Return values
mixed —__construct()
Static-only class.
private
__construct() : mixed