get_stylesheet_uri

函数


get_stylesheet_uri ( No parameters )
返回值
  • (string) URI to active theme’s stylesheet.
定义位置
  • wp-includes/theme.php
    , line 242
引入
1.5.0
弃用

检索活动主题的样式表URI。

样式表的文件名是’style.css’,它被附加到样式表目录URI路径上。参见get_stylesheet_directory_uri()。

function get_stylesheet_uri() {
	$stylesheet_dir_uri = get_stylesheet_directory_uri();
	$stylesheet_uri     = $stylesheet_dir_uri . '/style.css';
	/**
	 * Filters the URI of the active theme stylesheet.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet_uri     Stylesheet URI for the active theme/child theme.
	 * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
	 */
	return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
}