On this page
includes_url( string $path = '', string|null $scheme = null ): string
Retrieves the URL to the includes directory.
Parameters
$pathstring Optional-
Path relative to the includes URL.
Default:
'' $schemestring|null Optional-
Scheme to give the includes URL context. Accepts
'http','https', or'relative'.Default:
null
Return
string Includes URL link with optional path appended.
Source
File: wp-includes/link-template.php. View all references
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 );
}
Hooks
- apply_filters( 'includes_url',
string $url ,string $path ,string|null $scheme ) -
Filters the URL to the includes directory.
Related
Uses
| Uses | Description |
|---|---|
| site_url() wp-includes/link-template.php | Retrieves the URL for the current site where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Used By
| Used By | Description |
|---|---|
| wp_is_local_html_output() wp-includes/https-detection.php | Checks whether a given HTML string is likely an output from this WordPress site. |
| register_block_script_handle() wp-includes/blocks.php | Finds a script handle for the selected block metadata field. It detects when a path to file was provided and finds a corresponding asset file with details necessary to register the script under automatically generated handle name. It returns unprocessed script handle otherwise. |
| register_block_style_handle() wp-includes/blocks.php | Finds a style handle for the block metadata field. It detects when a path to file was provided and registers the style under automatically generated handle name. It returns unprocessed style handle otherwise. |
| do_favicon() wp-includes/functions.php | Displays the favicon.ico file content. |
| wp_register_tinymce_scripts() wp-includes/script-loader.php | Registers TinyMCE scripts. |
| wp_tinymce_inline_scripts() wp-includes/script-loader.php | Adds inline scripts required for the TinyMCE in the block editor. |
| _WP_Editors::get_baseurl() wp-includes/class-wp-editor.php | Returns the TinyMCE base URL. |
| _WP_Editors::default_settings() wp-includes/class-wp-editor.php | Returns the default TinyMCE settings. |
| the_embed_site_title() wp-includes/embed.php | Prints the necessary markup for the site title in an embed template. |
| wpview_media_sandbox_styles() wp-includes/media.php | Returns the URLs for CSS files used in an iframe-sandbox’d TinyMCE media view. |
| wp_ajax_parse_embed() wp-admin/includes/ajax-actions.php | Apply [embed] Ajax handlers to a string. |
| _thickbox_path_admin_subfolder() wp-admin/includes/ms.php | Thickbox image paths for Network Admin. |
| translate_smiley() wp-includes/formatting.php | Converts one smiley code to the icon graphic file equivalent. |
| wlwmanifest_link() wp-includes/general-template.php | Displays the link to the Windows Live Writer manifest file. |
| WP_Widget_RSS::widget() wp-includes/widgets/class-wp-widget-rss.php | Outputs the content for the current RSS widget instance. |
| wp_mime_type_icon() wp-includes/post.php | Retrieves the icon for a MIME type or attachment. |
| wp_default_scripts() wp-includes/script-loader.php | Registers all WordPress scripts. |
Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/includes_url