Changeset 14347 for trunk/wp-includes/link-template.php
- Timestamp:
- 05/02/2010 10:53:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r14208 r14347 1825 1825 * @return string Home url link with optional path appended. 1826 1826 */ 1827 function home_url( $path = '', $scheme = null ) {1828 return get_home_url(null, $path, $scheme );1827 function home_url( $path = '', $scheme = null, $esc_url = true ) { 1828 return get_home_url(null, $path, $scheme, $esc_url); 1829 1829 } 1830 1830 … … 1844 1844 * @return string Home url link with optional path appended. 1845 1845 */ 1846 function get_home_url( $blog_id = null, $path = '', $scheme = null ) {1846 function get_home_url( $blog_id = null, $path = '', $scheme = null, $esc_url = true ) { 1847 1847 $orig_scheme = $scheme; 1848 1848 … … 1860 1860 $url .= '/' . ltrim( $path, '/' ); 1861 1861 1862 return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); 1862 $url = apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); 1863 1864 if ( $esc_url ) 1865 $url = esc_url($url); 1866 1867 return $url; 1863 1868 } 1864 1869 … … 1879 1884 * @return string Site url link with optional path appended. 1880 1885 */ 1881 function site_url( $path = '', $scheme = null ) {1882 return get_site_url(null, $path, $scheme );1886 function site_url( $path = '', $scheme = null, $esc_url = true ) { 1887 return get_site_url(null, $path, $scheme, $esc_url); 1883 1888 } 1884 1889 … … 1898 1903 * @return string Site url link with optional path appended. 1899 1904 */ 1900 function get_site_url( $blog_id = null, $path = '', $scheme = null ) {1905 function get_site_url( $blog_id = null, $path = '', $scheme = null, $esc_url = true ) { 1901 1906 // should the list of allowed schemes be maintained elsewhere? 1902 1907 $orig_scheme = $scheme; … … 1922 1927 $url .= '/' . ltrim($path, '/'); 1923 1928 1924 return apply_filters('site_url', $url, $path, $orig_scheme, $blog_id); 1929 $url = apply_filters('site_url', $url, $path, $orig_scheme, $blog_id); 1930 1931 if ( $esc_url ) 1932 $url = esc_url($url); 1933 1934 return $url; 1925 1935 } 1926 1936 … … 1935 1945 * @return string Admin url link with optional path appended 1936 1946 */ 1937 function admin_url( $path = '', $scheme = 'admin' ) {1938 return get_admin_url(null, $path, $scheme );1947 function admin_url( $path = '', $scheme = 'admin', $esc_url = true ) { 1948 return get_admin_url(null, $path, $scheme, $esc_url); 1939 1949 } 1940 1950 … … 1950 1960 * @return string Admin url link with optional path appended 1951 1961 */ 1952 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {1962 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin', $esc_url = true ) { 1953 1963 $url = get_site_url($blog_id, 'wp-admin/', $scheme); 1954 1964 … … 1956 1966 $url .= ltrim($path, '/'); 1957 1967 1958 return apply_filters('admin_url', $url, $path, $blog_id); 1968 $url = apply_filters('admin_url', $url, $path, $blog_id); 1969 1970 if ( $esc_url ) 1971 $url = esc_url($url); 1972 1973 return $url; 1959 1974 } 1960 1975 … … 1968 1983 * @return string Includes url link with optional path appended. 1969 1984 */ 1970 function includes_url($path = '' ) {1985 function includes_url($path = '', $esc_url = true) { 1971 1986 $url = site_url() . '/' . WPINC . '/'; 1972 1987 … … 1974 1989 $url .= ltrim($path, '/'); 1975 1990 1976 return apply_filters('includes_url', $url, $path); 1991 $url = apply_filters('includes_url', $url, $path); 1992 1993 if ( $esc_url ) 1994 $url = esc_url($url); 1995 1996 return $url; 1977 1997 } 1978 1998 … … 1986 2006 * @return string Content url link with optional path appended. 1987 2007 */ 1988 function content_url($path = '' ) {2008 function content_url($path = '', $esc_url = true) { 1989 2009 $url = WP_CONTENT_URL; 1990 2010 if ( 0 === strpos($url, 'http') && is_ssl() ) … … 1994 2014 $url .= '/' . ltrim($path, '/'); 1995 2015 1996 return apply_filters('content_url', $url, $path); 2016 $url = apply_filters('content_url', $url, $path); 2017 2018 if ( $esc_url ) 2019 $url = esc_url($url); 2020 2021 return $url; 1997 2022 } 1998 2023 … … 2008 2033 * @return string Plugins url link with optional path appended. 2009 2034 */ 2010 function plugins_url($path = '', $plugin = '' ) {2035 function plugins_url($path = '', $plugin = '', $esc_url = true) { 2011 2036 2012 2037 $mu_plugin_dir = WPMU_PLUGIN_DIR; … … 2033 2058 $url .= '/' . ltrim($path, '/'); 2034 2059 2035 return apply_filters('plugins_url', $url, $path, $plugin); 2060 $url = apply_filters('plugins_url', $url, $path, $plugin); 2061 2062 if ( $esc_url ) 2063 $url = esc_url($url); 2064 2065 return $url; 2066 2036 2067 } 2037 2068 … … 2050 2081 * @return string Site url link with optional path appended. 2051 2082 */ 2052 function network_site_url( $path = '', $scheme = null ) {2083 function network_site_url( $path = '', $scheme = null, $esc_url = true ) { 2053 2084 global $current_site; 2054 2085 … … 2075 2106 $url .= ltrim($path, '/'); 2076 2107 2077 return apply_filters('network_site_url', $url, $path, $orig_scheme); 2108 $url = apply_filters('network_site_url', $url, $path, $orig_scheme); 2109 2110 if ( $esc_url ) 2111 $url = esc_url($url); 2112 2113 return $url; 2078 2114 } 2079 2115 … … 2092 2128 * @return string Home url link with optional path appended. 2093 2129 */ 2094 function network_home_url( $path = '', $scheme = null ) {2130 function network_home_url( $path = '', $scheme = null, $esc_url = true ) { 2095 2131 global $current_site; 2096 2132 … … 2110 2146 $url .= ltrim( $path, '/' ); 2111 2147 2112 return apply_filters( 'network_home_url', $url, $path, $orig_scheme); 2148 $url = apply_filters( 'network_home_url', $url, $path, $orig_scheme); 2149 2150 if ( $esc_url ) 2151 $url = esc_url($url); 2152 2153 return $url; 2113 2154 } 2114 2155 … … 2123 2164 * @return string Admin url link with optional path appended 2124 2165 */ 2125 function network_admin_url( $path = '', $scheme = 'admin' ) {2166 function network_admin_url( $path = '', $scheme = 'admin', $esc_url = true ) { 2126 2167 $url = network_site_url('wp-admin/', $scheme); 2127 2168 … … 2129 2170 $url .= ltrim($path, '/'); 2130 2171 2131 return apply_filters('network_admin_url', $url, $path); 2172 $url = apply_filters('network_admin_url', $url, $path); 2173 2174 if ( $esc_url ) 2175 $url = esc_url($url); 2176 2177 return $url; 2132 2178 } 2133 2179
Note: See TracChangeset
for help on using the changeset viewer.