Register some useful assets in WordPress

author etessore
version 1.0.1
package classes

 Methods

__construct()

__construct() 

Adds a css to the current set

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

Parameters

$handle

string

Name of the stylesheet.

$src

stringbool

Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.

$deps

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.

$ver

stringbool

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.

$media

string

The media for which this stylesheet has been defined.

Returns

\DefaultAssets$this for chainability

Adds a javascript to the current set

add_js(string $handle, string $src, array $deps, string | bool $ver, bool $in_footer) : \DefaultAssets
see http://codex.wordpress.org/Function_Reference/wp_register_script

Parameters

$handle

string

Script name

$src

string

Script url

$deps

array

(optional) Array of script names on which this script depends

$ver

stringbool

(optional) Script version (used for cache busting), set to NULL to disable

$in_footer

bool

(optional) Whether to enqueue the script before or before

Returns

\DefaultAssets$this for chainability

register_custom()

register_custom() 

register_standard()

register_standard() 

 Properties

 

$assets_manager