content_url
函数
content_url ( $path = '' )
- 参数
-
-
(string)
$path
Optional. Path relative to the content URL. Default empty.- Required: 否
- Default: (empty)
-
(string)
- 返回值
-
- (string) Content URL link with optional path appended.
- 定义位置
-
-
wp-includes/link-template.php
, line 3529
-
wp-includes/link-template.php
- 引入
- 2.6.0
- 弃用
- –
Retrieves the URL to the content directory.
function content_url( $path = '' ) { $url = set_url_scheme( WP_CONTENT_URL ); if ( $path && is_string( $path ) ) { $url .= '/' . ltrim( $path, '/' ); } /** * Filters the URL to the content directory. * * @since 2.8.0 * * @param string $url The complete URL to the content directory including scheme and path. * @param string $path Path relative to the URL to the content directory. Blank string * if no path is specified. */ return apply_filters( 'content_url', $url, $path ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。