我正在尝试使用将rel=\'stylesheet\'更改为rel=\'preload\'style_loader_tag
但它没有做什么。谁能告诉我我的代码有什么问题吗?
add_filter( \'style_loader_tag\', \'preload_css\', 10, 2 );
function preload_css( $html, $handle ){
$targetHanldes = array(\'flexible_shipping_notices\', \'animate-css\');
if( in_array( $handle, $targetHanldes ) ){
$html = str_replace("rel=\'stylesheet\'", "rel=\'preload\'", $html);
}
return $html;
}