get_stylesheet_uri() - WordPress 函数参考中文文档

返回介绍

get_stylesheet_uri()

发布于 2017-09-11 字数2001 浏览 825 评论 0

get_stylesheet_uri()

Retrieves the URI of current theme stylesheet.


描述

The stylesheet file name is ‘style.css’ which is appended to the stylesheet directory URI path. See get_stylesheet_directory_uri().


返回值

(string)


源代码

File: wp-includes/theme.php

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

更新日志

Version 描述
1.5.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    get_stylesheet_directory_uri()
  • wp-includes/theme.php:
    stylesheet_uri
  • wp-includes/plugin.php:
    apply_filters()

Used By

  • wp-includes/general-template.php:
    get_bloginfo()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    To output the URL

    
    <?php echo get_stylesheet_uri(); ?>
    
    

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!