PHP Class WC_Frontend_Scripts

显示文件 Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
get_styles ( ) : array Get styles for the frontend.
init ( ) Hook in methods.
load_scripts ( ) Register/queue frontend scripts.
localize_printed_scripts ( ) Localize scripts only when enqueued.

Private Methods

Method Description
enqueue_script ( string $handle, string $path = '', string[] $deps = ['jquery'], string $version = WC_VERSION, boolean $in_footer = true ) Register and enqueue a script for use.
enqueue_style ( string $handle, string $path = '', string[] $deps = [], string $version = WC_VERSION, string $media = 'all' ) Register and enqueue a styles for use.
get_script_data ( string $handle ) : array | boolean Return data for script handles.
localize_script ( string $handle ) Localize a WC script once.
register_script ( string $handle, string $path, string[] $deps = ['jquery'], string $version = WC_VERSION, boolean $in_footer = true ) Register a script for use.
register_style ( string $handle, string $path, string[] $deps = [], string $version = WC_VERSION, string $media = 'all' ) Register a style for use.

Method Details

get_styles() public static method

Get styles for the frontend.
public static get_styles ( ) : array
return array

init() public static method

Hook in methods.
public static init ( )

load_scripts() public static method

Register/queue frontend scripts.
public static load_scripts ( )

localize_printed_scripts() public static method

Localize scripts only when enqueued.
public static localize_printed_scripts ( )