WordPress.org

Make WordPress Core

Ticket #19200: 19200b.patch

File 19200b.patch, 840 bytes (added by ramiy, 7 years ago)
  • link-template.php

     
    20522052}
    20532053
    20542054/**
     2055 * Retrieve the url to the upload directory.
     2056 *
     2057 * @package WordPress
     2058 * @since 3.3.0
     2059 *
     2060 * @param string $path Optional. Path relative to the upload url.
     2061 * @return string Upload url link with optional path appended.
     2062*/
     2063function upload_url( $path = '' ) {
     2064        $upload_dir = wp_upload_dir();
     2065        $url = $upload_dir['baseurl'];
     2066
     2067        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
     2068                $url .= '/' . ltrim($path, '/');
     2069
     2070        return apply_filters( 'upload_url', $url, $path );
     2071}
     2072
     2073/**
    20552074 * Retrieve the site url for the current network.
    20562075 *
    20572076 * Returns the site url with the appropriate protocol, 'https' if