
如何修复XAMPP“服务器证书不包含与服务器名称匹配的ID”错误
wp_admin_css ( $file = 'wp-admin', $force_echo = false )
列队或直接打印一个样式表链接到指定的CSS文件。
“智能 “地决定排队或打印CSS文件。如果{@see ‘wp_print_styles’}动作*还没有被调用,CSS文件将被排队。如果{@see ‘wp_print_styles’}动作已经被调用,CSS链接将被打印。可以通过传递true作为$force_echo(第二)参数来强制打印。
为了向后兼容WordPress 2.3的调用方法。如果$file(第一个)参数没有对应于一个已注册的CSS文件,我们假定$file是一个相对于wp-admin/的文件,没有”.css “扩展名。一个生成的URL的样式表链接会被打印出来。
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { // For backward compatibility. $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file; if ( wp_styles()->query( $handle ) ) { if ( $force_echo || did_action( 'wp_print_styles' ) ) { // We already printed the style queue. Print this one immediately. wp_print_styles( $handle ); } else { // Add to style queue. wp_enqueue_style( $handle ); } return; } $stylesheet_link = sprintf( "<link rel='stylesheet' href='%s' type='text/css' />n", esc_url( wp_admin_css_uri( $file ) ) ); /** * 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'. */ echo apply_filters( 'wp_admin_css', $stylesheet_link, $file ); if ( function_exists( 'is_rtl' ) && is_rtl() ) { $rtl_stylesheet_link = sprintf( "<link rel='stylesheet' href='%s' type='text/css' />n", esc_url( wp_admin_css_uri( "$file-rtl" ) ) ); /** This filter is documented in wp-includes/general-template.php */ echo apply_filters( 'wp_admin_css', $rtl_stylesheet_link, "$file-rtl" ); } }