| | 2055 | * Retrieve the url to the themes directory. |
| | 2056 | * |
| | 2057 | * @package WordPress |
| | 2058 | * @since 3.4.0 |
| | 2059 | * |
| | 2060 | * @param string $path Optional. Path relative to the themes url. |
| | 2061 | * @return string Themes url link with optional path appended. |
| | 2062 | */ |
| | 2063 | function themes_url( $path = '' ) { |
| | 2064 | $url = get_theme_root_uri(); |
| | 2065 | |
| | 2066 | if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) |
| | 2067 | $url .= '/' . ltrim($path, '/'); |
| | 2068 | |
| | 2069 | return apply_filters( 'themes_url', $url, $path ); |
| | 2070 | } |
| | 2071 | |
| | 2072 | * Retrieve the url to the upload directory. |
| | 2073 | * |
| | 2074 | * @package WordPress |
| | 2075 | * @since 3.4.0 |
| | 2076 | * |
| | 2077 | * @param string $path Optional. Path relative to the upload url. |
| | 2078 | * @return string Upload url link with optional path appended. |
| | 2079 | */ |
| | 2080 | function upload_url( $path = '' ) { |
| | 2081 | $upload_dir = wp_upload_dir(); |
| | 2082 | $url = $upload_dir['baseurl']; |
| | 2083 | |
| | 2084 | if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) |
| | 2085 | $url .= '/' . ltrim($path, '/'); |
| | 2086 | |
| | 2087 | return apply_filters( 'upload_url', $url, $path ); |
| | 2088 | } |
| | 2089 | |
| | 2090 | /** |