Automattic\WooCommerce\Blocks
Assets::register_style() protected WC 2.0.0
Registers a style according to wp_register_style.
{} Это метод класса: Assets{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$result = Assets::register_style( $handle, $src, $deps, $media );
- $handle(строка) (обязательный)
- Name of the stylesheet. Should be unique.
- $src(строка) (обязательный)
- Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
- $deps(массив)
- An array of registered stylesheet handles this stylesheet depends on.
По умолчанию: empty array - $media(строка)
- 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)'.
По умолчанию: 'all'
Список изменений
С версии 2.0.0 | Введена. |
Код Assets::register_style() Assets::register style WC 5.0.0
protected static function register_style( $handle, $src, $deps = [], $media = 'all' ) {
$filename = str_replace( plugins_url( '/', __DIR__ ), '', $src );
$ver = self::get_file_version( $filename );
wp_register_style( $handle, $src, $deps, $ver, $media );
}