includes_url()

最后更新于:2021-11-27 06:50:30

includes_url( string$path=”, string|null$scheme=null)

Retrieves the URL to the includes directory.

参数

$path

(string) (Optional) Path relative to the includes URL.

Default value: ”

$scheme

(string|null) (Optional) Scheme to give the includes URL context. Accepts ‘http’, ‘https’, or ‘relative’.

Default value: null

响应

(string) Includes URL link with optional path appended.

源文件

文件: gc-includes/link-template.php

function includes_url( $path = '', $scheme = null ) {
	$url = site_url( '/' . GCINC . '/', $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 gc-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 );
}