Automattic\WooCommerce\Internal\Admin

WCAdminAssets::register_style()public staticWC 1.0

Loads a style

Метод класса: WCAdminAssets{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WCAdminAssets::register_style( $style_path_name, $style_name, $dependencies );
$style_path_name(строка) (обязательный)
The style path name.
$style_name(строка) (обязательный)
Filename of the style to load.
$dependencies(массив)
Array of any extra dependencies.
По умолчанию: array()

Код WCAdminAssets::register_style() WC 9.8.1

public static function register_style( $style_path_name, $style_name, $dependencies = array() ) {
	$style_assets_filename = self::get_script_asset_filename( $style_path_name, $style_name );
	$style_assets          = require WC_ADMIN_ABSPATH . WC_ADMIN_DIST_CSS_FOLDER . $style_path_name . '/' . $style_assets_filename;

	$handle = 'wc-admin-' . $style_name;
	wp_enqueue_style(
		$handle,
		self::get_url( $style_path_name . '/' . $style_name, 'css' ),
		$dependencies,
		self::get_file_version( 'css', $style_assets['version'] ),
	);
	wp_style_add_data( $handle, 'rtl', 'replace' );
}