Filter hook 'wp_admin_css'

in WP Core File wp-includes/general-template.php at line 5063

View Source

wp_admin_css

Filter Hook
Description
Filters the stylesheet link to the specified CSS file. If the site is set to display right-to-left, the RTL stylesheet link will be used instead.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 5063

Hook Parameters

Type Name Description
string $stylesheet_link HTML link element for the stylesheet.
string $file Style handle name or filename (without ".css" extension) relative to wp-admin/. Defaults to 'wp-admin'.

Usage Examples

Basic Usage
<?php
// Hook into wp_admin_css
add_filter('wp_admin_css', 'my_custom_filter', 10, 2);

function my_custom_filter($stylesheet_link, $file) {
    // Your custom filtering logic here
    return $stylesheet_link;
}

Source Code Context

wp-includes/general-template.php:5063 - How this hook is used in WordPress core
<?php
5058  			"<link rel='stylesheet' href='%s' type='text/css' />\n",
5059  			esc_url( wp_admin_css_uri( "$file-rtl" ) )
5060  		);
5061  
5062  		/** This filter is documented in wp-includes/general-template.php */
5063  		echo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, "$file-rtl" );
5064  	}
5065  }
5066  
5067  /**
5068   * Enqueues the default ThickBox js and css.

PHP Documentation

<?php
/**
	 * Filters the stylesheet link to the specified CSS file.
	 *
	 * If the site is set to display right-to-left, the RTL stylesheet link
	 * will be used instead.
	 *
	 * @since 2.3.0
	 * @param string $stylesheet_link HTML link element for the stylesheet.
	 * @param string $file            Style handle name or filename (without ".css" extension)
	 *                                relative to wp-admin/. Defaults to 'wp-admin'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.