wp_admin_css

Filters the stylesheet link to the specified CSS file.

Description

apply_filters( 'wp_admin_css', (string) $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n, (unknown) $file ); 

If the site is set to display right-to-left, the RTL stylesheet link will be used instead.

Parameters (2)

0. $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n — Optional. (string) => "\n"
The link rel stylesheet href esc url wp admin css uri file type text css n.
1. $file (unknown)
The file.

Usage

To run the hook, copy the example below.
  1. $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n = apply_filters( 'wp_admin_css', $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n, $file ); 
  2.  
  3. if ( !empty( $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_admin_css callback 
  2. function filter_wp_admin_css( $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n, $file ) { 
  3. // make filter magic happen here... 
  4. return $link_rel_stylesheet_href_esc_url_wp_admin_css_uri_file_type_text_css_n
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_admin_css', 'filter_wp_admin_css', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_admin_css', 'filter_wp_admin_css', 10, 2 ); 

Defined (2)

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

/wp-includes/general-template.php  
  1. echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file ); 
  1. echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );