WC_Frontend_Scripts::register_style()
Register a style for use.
Method of the class: WC_Frontend_Scripts{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Frontend_Scripts::register_style( $handle, $path, $deps, $version, $media, $has_rtl );
- $handle(string) (required)
- Name of the stylesheet. Should be unique.
- $path(string) (required)
- Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
- $deps(string[])
- An array of registered stylesheet handles this stylesheet depends on.
Default: array() - $version(string)
- String specifying stylesheet version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
Default: WC_VERSION - $media(string)
- The media for which this stylesheet has been defined. Accepts media types like 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'.
Default: 'all' - $has_rtl(true|false)
- If has RTL version to load too.
Default: false
WC_Frontend_Scripts::register_style() WC Frontend Scripts::register style code WC 9.5.1
private static function register_style( $handle, $path, $deps = array(), $version = WC_VERSION, $media = 'all', $has_rtl = false ) { self::$styles[] = $handle; wp_register_style( $handle, $path, $deps, $version, $media ); if ( $has_rtl ) { wp_style_add_data( $handle, 'rtl', 'replace' ); } }