Daily Archives: July 18, 2017

WordPress – analysis wp_admin_css(‘install’,true);

as we know css is key role for web page,

wordpress using wp_admin_css(‘install’, true); to print link css.
in format of <link href=’…/xxx.css’>

the most important statement.

1
$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media);

“<link rel=’$rel’ id=’$handle-css’ $title href=’$href’ type=’text/css’ media=’$media’ />\n” will be replaced
to be ‘<link rel=’stylesheet’ id=’install-css’ href=’http://localhost:8082/wordpress2/wp-admin/css/install.min.css?ver=4.7.2′ type=’text/css’ media=’all’ />

Let’s look at what define of apply_filters, “apply_filters($tag,$value)”. ‘style_loader_tag’ has nothing in global variable $wp_filter.

Therefore, apply_filters do nothing here, it only return second param as string to print.

1
2
3
4
echo $conditional_pre;
echo $tag;
$this->print_inline_style( $handle );
echo $conditional_post;