wp_admin_css [ WordPress Function ]
| Parameters: |
|
| Uses: |
|
| Defined at: |
|
Enqueues or directly prints a stylesheet link to the specified CSS file.
"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.
Source
<?php
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
global $wp_styles;
if ( !is_a($wp_styles, 'WP_Styles') )
$wp_styles = new WP_Styles();
// For backward compatibility
$handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
if ( $wp_styles->query( $handle ) ) {
if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
wp_print_styles( $handle );
else // Add to style queue
wp_enqueue_style( $handle );
return;
}
echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file );
if ( function_exists( 'is_rtl' ) && is_rtl() )
echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- WordPress › Support » wp_admin_css
has anyone got wp_admin_css to work the way it is described in the codex? For instance in 'Creating Admin Themes'. There are a lot of posts saying it doesn't ...
wordpress.org - Creating Admin Themes « WordPress Codex
You can look at the files stored in /wp-admin/css to see all the style components that go into the admin dashboard. Here is a partial list of the important style ...
codex.wordpress.org - wp_admin_css Wordpress hook details -- Adam Brown, BYU ...
Detailed information about every action hook and filter used in WordPress. Makes Plugin API easier to use. Lists appearance, file location, and deprecation data ...
adambrown.info - wp_admin_css (WordPress Function) - WPSeek.com
WordPress lookup for wp_admin_css, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com