content_url

The timeline below displays how wordpress function content_url has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.6

/**
 * Retrieves the URL to the content directory.
 *
 * @since 2.6.0
 *
 * @param string $path Optional. Path relative to the content URL. Default empty.
 * @return string Content URL link with optional path appended.
 */
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);
}

WordPress Version: 4.5

/**
 * Retrieve the url to the content directory.
 *
 * @since 2.6.0
 *
 * @param string $path Optional. Path relative to the content url.
 * @return string Content url link with optional path appended.
 */
function content_url($path = '')
{
    $url = set_url_scheme(WP_CONTENT_URL);
    if ($path && is_string($path)) {
        $url .= '/' . ltrim($path, '/');
    }
    /**
     * Filter 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);
}

WordPress Version: 3.9

/**
 * Retrieve the url to the content directory.
 *
 * @since 2.6.0
 *
 * @param string $path Optional. Path relative to the content url.
 * @return string Content url link with optional path appended.
*/
function content_url($path = '')
{
    $url = set_url_scheme(WP_CONTENT_URL);
    if ($path && is_string($path)) {
        $url .= '/' . ltrim($path, '/');
    }
    /**
     * Filter 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);
}

WordPress Version: 3.7

/**
 * Retrieve the url to the content directory.
 *
 * @package WordPress
 * @since 2.6.0
 *
 * @param string $path Optional. Path relative to the content url.
 * @return string Content url link with optional path appended.
*/
function content_url($path = '')
{
    $url = set_url_scheme(WP_CONTENT_URL);
    if ($path && is_string($path)) {
        $url .= '/' . ltrim($path, '/');
    }
    return apply_filters('content_url', $url, $path);
}