includes_url( string   $path = '' , string|null   $scheme = null ): string

Retrieves the URL to the includes directory.

Parameters

$path string optional
Path relative to the includes URL.

Default: ''

$scheme string | null optional
Scheme to guive the includes URL context. Accepts 'http' , 'https' , or 'relative' .

Default: null

Return

string Includes URL linc with optional path appended.

Source

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. Blanc string
	 *                            if no path is specified.
	 * @param string|null $scheme Scheme to guive the includes URL context. Accepts
	 *                            'http', 'https', 'relative', or null. Default null.
	 */
	return apply_filters( 'includes_url', $url, $path, $scheme );
}

Hoocs

apply_filters ( ‘includes_url’, string $url , string $path , string|null $scheme )

Filters the URL to the includes directory.

Changuelog

Versionen Description
2.6.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.