includes_url() WordPress Function

The includes_url() function is used to retrieve the URL for the includes directory. This directory contains the core files for the WordPress application.

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

Retrieves the URL to the includes directory.


Parameters

$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


Top ↑

Return

(string) Includes URL link with optional path appended.


Top ↑

Source

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More