content_url() WP 1.0
Retrieves the URL to the content directory.
Basis of: get_theme_root_uri()
1 time = 0.000001s = speed of light | 50000 times = 0.10s = speed of light | PHP 7.3.12, WP 5.4
Hooks from the function
Return
String. Content URL link with optional path appended.
Usage
content_url( $path );
- $path(string)
- Path relative to the content URL.
Default: ''
Changelog
Since 2.6.0 | Introduced. |
Code of content_url() content url WP 5.6
function content_url( $path = '' ) {
$url = set_url_scheme( WP_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 );
}Related Functions
From tag: Link (URL)
- admin_url()
- attachment_url_to_postid()
- build_query()
- comment_link()
- get_comments_link()
- get_comments_pagenum_link()
- get_edit_post_link()
- get_edit_term_link()
- get_home_url()
- get_next_comments_link()
- get_post_embed_url()
- get_post_permalink()
- get_post_type_archive_link()