Changeset 14374 for trunk/wp-includes/link-template.php
- Timestamp:
- 05/03/2010 06:16:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r14372 r14374 785 785 return; 786 786 787 if ( 'display' == $context ) 788 $action = '&action=edit'; 789 else 790 $action = '&action=edit'; 791 787 792 $post_type_object = get_post_type_object( $post->post_type ); 788 793 if ( !$post_type_object ) … … 792 797 return; 793 798 794 $url = admin_url( sprintf($post_type_object->_edit_link, $post->ID) ); 795 796 if ( 'display' == $context ) 797 $url .= '&action=edit'; 798 else 799 $url .= '&action=edit'; 800 801 return apply_filters( 'get_edit_post_link', $url , $post->ID, $context ); 799 return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID) ), $post->ID, $context ); 802 800 } 803 801 … … 1827 1825 * @return string Home url link with optional path appended. 1828 1826 */ 1829 function home_url( $path = '', $scheme = null , $esc_url = true) {1830 return get_home_url(null, $path, $scheme , $esc_url);1827 function home_url( $path = '', $scheme = null ) { 1828 return get_home_url(null, $path, $scheme); 1831 1829 } 1832 1830 … … 1846 1844 * @return string Home url link with optional path appended. 1847 1845 */ 1848 function get_home_url( $blog_id = null, $path = '', $scheme = null , $esc_url = true) {1846 function get_home_url( $blog_id = null, $path = '', $scheme = null ) { 1849 1847 $orig_scheme = $scheme; 1850 1848 … … 1862 1860 $url .= '/' . ltrim( $path, '/' ); 1863 1861 1864 $url = apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); 1865 1866 if ( $esc_url ) 1867 $url = esc_url($url); 1868 1869 return $url; 1862 return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); 1870 1863 } 1871 1864 … … 1886 1879 * @return string Site url link with optional path appended. 1887 1880 */ 1888 function site_url( $path = '', $scheme = null , $esc_url = true) {1889 return get_site_url(null, $path, $scheme , $esc_url);1881 function site_url( $path = '', $scheme = null ) { 1882 return get_site_url(null, $path, $scheme); 1890 1883 } 1891 1884 … … 1905 1898 * @return string Site url link with optional path appended. 1906 1899 */ 1907 function get_site_url( $blog_id = null, $path = '', $scheme = null , $esc_url = true) {1900 function get_site_url( $blog_id = null, $path = '', $scheme = null ) { 1908 1901 // should the list of allowed schemes be maintained elsewhere? 1909 1902 $orig_scheme = $scheme; … … 1929 1922 $url .= '/' . ltrim($path, '/'); 1930 1923 1931 $url = apply_filters('site_url', $url, $path, $orig_scheme, $blog_id); 1932 1933 if ( $esc_url ) 1934 $url = esc_url($url); 1935 1936 return $url; 1924 return apply_filters('site_url', $url, $path, $orig_scheme, $blog_id); 1937 1925 } 1938 1926 … … 1947 1935 * @return string Admin url link with optional path appended 1948 1936 */ 1949 function admin_url( $path = '', $scheme = 'admin' , $esc_url = true) {1950 return get_admin_url(null, $path, $scheme , $esc_url);1937 function admin_url( $path = '', $scheme = 'admin' ) { 1938 return get_admin_url(null, $path, $scheme); 1951 1939 } 1952 1940 … … 1962 1950 * @return string Admin url link with optional path appended 1963 1951 */ 1964 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' , $esc_url = true) {1952 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { 1965 1953 $url = get_site_url($blog_id, 'wp-admin/', $scheme); 1966 1954 … … 1968 1956 $url .= ltrim($path, '/'); 1969 1957 1970 $url = apply_filters('admin_url', $url, $path, $blog_id); 1971 1972 if ( $esc_url ) 1973 $url = esc_url($url); 1974 1975 return $url; 1958 return apply_filters('admin_url', $url, $path, $blog_id); 1976 1959 } 1977 1960 … … 1985 1968 * @return string Includes url link with optional path appended. 1986 1969 */ 1987 function includes_url($path = '' , $esc_url = true) {1970 function includes_url($path = '') { 1988 1971 $url = site_url() . '/' . WPINC . '/'; 1989 1972 … … 1991 1974 $url .= ltrim($path, '/'); 1992 1975 1993 $url = apply_filters('includes_url', $url, $path); 1994 1995 if ( $esc_url ) 1996 $url = esc_url($url); 1997 1998 return $url; 1976 return apply_filters('includes_url', $url, $path); 1999 1977 } 2000 1978 … … 2008 1986 * @return string Content url link with optional path appended. 2009 1987 */ 2010 function content_url($path = '' , $esc_url = true) {1988 function content_url($path = '') { 2011 1989 $url = WP_CONTENT_URL; 2012 1990 if ( 0 === strpos($url, 'http') && is_ssl() ) … … 2016 1994 $url .= '/' . ltrim($path, '/'); 2017 1995 2018 $url = apply_filters('content_url', $url, $path); 2019 2020 if ( $esc_url ) 2021 $url = esc_url($url); 2022 2023 return $url; 1996 return apply_filters('content_url', $url, $path); 2024 1997 } 2025 1998 … … 2035 2008 * @return string Plugins url link with optional path appended. 2036 2009 */ 2037 function plugins_url($path = '', $plugin = '' , $esc_url = true) {2010 function plugins_url($path = '', $plugin = '') { 2038 2011 2039 2012 $mu_plugin_dir = WPMU_PLUGIN_DIR; … … 2060 2033 $url .= '/' . ltrim($path, '/'); 2061 2034 2062 $url = apply_filters('plugins_url', $url, $path, $plugin); 2063 2064 if ( $esc_url ) 2065 $url = esc_url($url); 2066 2067 return $url; 2068 2035 return apply_filters('plugins_url', $url, $path, $plugin); 2069 2036 } 2070 2037 … … 2083 2050 * @return string Site url link with optional path appended. 2084 2051 */ 2085 function network_site_url( $path = '', $scheme = null , $esc_url = true) {2052 function network_site_url( $path = '', $scheme = null ) { 2086 2053 global $current_site; 2087 2054 … … 2108 2075 $url .= ltrim($path, '/'); 2109 2076 2110 $url = apply_filters('network_site_url', $url, $path, $orig_scheme); 2111 2112 if ( $esc_url ) 2113 $url = esc_url($url); 2114 2115 return $url; 2077 return apply_filters('network_site_url', $url, $path, $orig_scheme); 2116 2078 } 2117 2079 … … 2130 2092 * @return string Home url link with optional path appended. 2131 2093 */ 2132 function network_home_url( $path = '', $scheme = null , $esc_url = true) {2094 function network_home_url( $path = '', $scheme = null ) { 2133 2095 global $current_site; 2134 2096 … … 2148 2110 $url .= ltrim( $path, '/' ); 2149 2111 2150 $url = apply_filters( 'network_home_url', $url, $path, $orig_scheme); 2151 2152 if ( $esc_url ) 2153 $url = esc_url($url); 2154 2155 return $url; 2112 return apply_filters( 'network_home_url', $url, $path, $orig_scheme); 2156 2113 } 2157 2114 … … 2166 2123 * @return string Admin url link with optional path appended 2167 2124 */ 2168 function network_admin_url( $path = '', $scheme = 'admin' , $esc_url = true) {2125 function network_admin_url( $path = '', $scheme = 'admin' ) { 2169 2126 $url = network_site_url('wp-admin/', $scheme); 2170 2127 … … 2172 2129 $url .= ltrim($path, '/'); 2173 2130 2174 $url = apply_filters('network_admin_url', $url, $path); 2175 2176 if ( $esc_url ) 2177 $url = esc_url($url); 2178 2179 return $url; 2131 return apply_filters('network_admin_url', $url, $path); 2180 2132 } 2181 2133
Note: See TracChangeset
for help on using the changeset viewer.