wp_admin_css( string $file = 'wp-admin', bool $force_echo = false )
Enqueues or directly prints a stylesheet link to the specified CSS file.
Description
"Intelligently" decides to enqueue or to print the CSS file. If the ‘wp_print_styles’ action has not yet been called, the CSS file will be enqueued. If the ‘wp_print_styles’ action has been called, the CSS link will be printed. Printing may be forced by passing true as the $force_echo (second) parameter.
For backward compatibility with WordPress 2.3 calling method: If the $file (first) parameter does not correspond to a registered CSS file, we assume $file is a file relative to wp-admin/ without its ".css" extension. A stylesheet link to that generated URL is printed.
Parameters
- $file
-
(Optional) Style handle name or file name (without ".css" extension) relative to wp-admin/. Defaults to 'wp-admin'.
Default value: 'wp-admin'
- $force_echo
-
(Optional) Force the stylesheet link to be printed rather than enqueued.
Default value: false
Source
File: wp-includes/general-template.php
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |