content_url()

最后更新于:2021-11-25 21:47:24

content_url( string$path=”)

Retrieves the URL to the content directory.

参数

$path

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

Default value: ”

响应

(string) Content URL link with optional path appended.

源文件

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

function content_url( $path = '' ) {
	$url = set_url_scheme( GC_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 );
}