wp_admin_css_uri

Displays the URL of a WordPress admin CSS file.

Description

(string) wp_admin_css_uri( (string) $file = 'wp-admin' ); 

Returns (string)

Parameters (1)

0. $file — Optional. (string) => 'wp-admin'
File relative to wp-admin/ without its .css extension.

Usage

  1. if ( !function_exists( 'wp_admin_css_uri' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // file relative to wp-admin/ without its ".css" extension. 
  5. $file = 'wp-admin'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_admin_css_uri($file); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function wp_admin_css_uri( $file = 'wp-admin' ) { 
  2. if ( defined('WP_INSTALLING') ) { 
  3. $_file = "./$file.css"; 
  4. } else { 
  5. $_file = admin_url("$file.css"); 
  6. $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); 
  7.  
  8. /** 
  9. * Filters the URI of a WordPress admin CSS file. 
  10. * @since 2.3.0 
  11. * @param string $_file Relative path to the file with query arguments attached. 
  12. * @param string $file Relative path to the file, minus its ".css" extension. 
  13. */ 
  14. return apply_filters( 'wp_admin_css_uri', $_file, $file );