wp_style_loader_src

Definition:
function wp_style_loader_src( $src, $handle ) {}

Administration Screen CSS for changing the styles.
If installing the ‘wp-admin/’ directory will be replaced with ‘./’.

Parameters

  • string $src: Source URL.
  • string $handle: Either ‘colors’ or ‘colors-rtl’.

Return values

returns:URL path to CSS stylesheet for Administration Screens.

Source code

function wp_style_loader_src( $src, $handle ) {

	if ( defined('WP_INSTALLING') )

		return preg_replace( '#^wp-admin/#', './', $src );



	if ( 'colors' == $handle || 'colors-rtl' == $handle ) {

		global $_wp_admin_css_colors;

		$color = get_user_option('admin_color');



		if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )

			$color = 'fresh';



		$color = $_wp_admin_css_colors[$color];

		$parsed = parse_url( $src );

		$url = $color->url;



		if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG )

			$url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url);



		if ( isset($parsed['query']) && $parsed['query'] ) {

			wp_parse_str( $parsed['query'], $qv );

			$url = add_query_arg( $qv, $url );

		}



		return $url;

	}



	return $src;

}

4151

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: