函数原型
includes_url( string $path = ”, string|null $scheme = null ): string
函数描述
Retrieves the URL to the includes directory.
是否弃用
未弃用
函数参数
-
$path
string
Optional - Path relative to the includes URL.
Default:
'' -
$scheme
string|null
Optional - Scheme to give the includes URL context. Accepts
'http','https', or'relative'.Default:
null
函数返回值
string Includes URL link with optional path appended.
函数位置
File: wp-includes/link-template.php.
函数源码
function includes_url( $path = '', $scheme = null ) {
$url = site_url( '/' . WPINC . '/', $scheme );
if ( $path && is_string( $path ) ) {
$url .= ltrim( $path, '/' );
}
/**
* Filters the URL to the includes directory.
*
* @since 2.8.0
* @since 5.8.0 The `$scheme` parameter was added.
*
* @param string $url The complete URL to the includes directory including scheme and path.
* @param string $path Path relative to the URL to the wp-includes directory. Blank string
* if no path is specified.
* @param string|null $scheme Scheme to give the includes URL context. Accepts
* 'http', 'https', 'relative', or null. Default null.
*/
return apply_filters( 'includes_url', $url, $path, $scheme );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |

