Manages the assets
Adds the possibility to load a javascript or a css in the middle in a template part without having the need to check if the asset can be loaded in the head or in the foot of the page.
Uses ob_start and a placeholder for the assets. It's a singleton beacause it has to be run only once
author | etessore |
---|---|
version | 1.0.0 |
package | classes |
add_css(string $handle, string | bool $src, array $deps, string | bool $ver, string $media) : \DefaultAssets
see | http://codex.wordpress.org/Function_Reference/wp_register_style |
---|
string
Name of the stylesheet.
string
bool
Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
array
Array of handles of any stylesheet that this stylesheet depends on. (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
string
bool
String specifying the stylesheet version number. Set to NULL to disable. Used to ensure that the correct version is sent to the client regardless of caching.
string
The media for which this stylesheet has been defined.
\DefaultAssets
$this for chainabilityadd_js(string $handle, string $src, array $deps, string | bool $ver, bool $in_footer) : \DefaultAssets
see | http://codex.wordpress.org/Function_Reference/wp_register_script |
---|
string
Script name
string
Script url
array
(optional) Array of script names on which this script depends
string
bool
(optional) Script version (used for cache busting), set to NULL to disable
bool
(optional) Whether to enqueue the script before or before
\DefaultAssets
$this for chainabilitycallback()
disable_automatic_manager() : \DefaultAssets
\DefaultAssets
$this for chainabilityenable_automatic_manager() : \DefaultAssets
\DefaultAssets
$this for chainabilityget_instance() : \AutomaticAssetsManager
\AutomaticAssetsManager
unique instancehook() : \DefaultAssets
\DefaultAssets
$this for chainabilityobstart_init()
obstart_replace_assets_marker()
on_wp_print_scripts()
on_wp_print_styles()
__construct()
$assets : \arrary
$base_dir : array
$instance
$status : boolean
BOTTOM_JS_MARKER : string
CSS_MARKER : string
TOP_JS_MARKER : \stirng