wp_admin_css_uri

函数
wp_admin_css_uri ( $file = 'wp-admin' )
参数
  • (string) $file file relative to wp-admin/ without its ".css" extension.
    Required:
    Default: 'wp-admin'
返回值
  • (string)
相关
  • WP_Styles::_css_href()
定义位置
相关方法
wp_admin_csswp_admin_css_colorwp_admin_canonical_url_wp_admin_bar_initadmin_url
引入
2.3.0
弃用
-

wp_admin_css_uri: 这个函数返回管理员的CSS目录的URI。它返回管理员的CSS目录的URL。

显示WordPress管理CSS文件的URL。

function wp_admin_css_uri( $file = 'wp-admin' ) {
	if ( defined( 'WP_INSTALLING' ) ) {
		$_file = "./$file.css";
	} else {
		$_file = admin_url( "$file.css" );
	}
	$_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file );

	/**
	 * Filters the URI of a WordPress admin CSS file.
	 *
	 * @since 2.3.0
	 *
	 * @param string $_file Relative path to the file with query arguments attached.
	 * @param string $file  Relative path to the file, minus its ".css" extension.
	 */
	return apply_filters( 'wp_admin_css_uri', $_file, $file );
}

常见问题

FAQs
查看更多 >