Make WordPress Core


Ignore:
Timestamp:
05/03/2010 06:16:22 PM (16 years ago)
Author:
ryan
Message:

Revert [14347] and [14372]. It broke more than we expected. Try again in 3.1. see #13051

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r14372 r14374  
    785785                return;
    786786
     787        if ( 'display' == $context )
     788                $action = '&action=edit';
     789        else
     790                $action = '&action=edit';
     791
    787792        $post_type_object = get_post_type_object( $post->post_type );
    788793        if ( !$post_type_object )
     
    792797                return;
    793798
    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 );
    802800}
    803801
     
    18271825 * @return string Home url link with optional path appended.
    18281826*/
    1829 function home_url( $path = '', $scheme = null, $esc_url = true ) {
    1830         return get_home_url(null, $path, $scheme, $esc_url);
     1827function home_url( $path = '', $scheme = null ) {
     1828        return get_home_url(null, $path, $scheme);
    18311829}
    18321830
     
    18461844 * @return string Home url link with optional path appended.
    18471845*/
    1848 function get_home_url( $blog_id = null, $path = '', $scheme = null, $esc_url = true ) {
     1846function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
    18491847        $orig_scheme = $scheme;
    18501848
     
    18621860                $url .= '/' . ltrim( $path, '/' );
    18631861
    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 );
    18701863}
    18711864
     
    18861879 * @return string Site url link with optional path appended.
    18871880*/
    1888 function site_url( $path = '', $scheme = null, $esc_url = true ) {
    1889         return get_site_url(null, $path, $scheme, $esc_url);
     1881function site_url( $path = '', $scheme = null ) {
     1882        return get_site_url(null, $path, $scheme);
    18901883}
    18911884
     
    19051898 * @return string Site url link with optional path appended.
    19061899*/
    1907 function get_site_url( $blog_id = null, $path = '', $scheme = null, $esc_url = true ) {
     1900function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
    19081901        // should the list of allowed schemes be maintained elsewhere?
    19091902        $orig_scheme = $scheme;
     
    19291922                $url .= '/' . ltrim($path, '/');
    19301923
    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);
    19371925}
    19381926
     
    19471935 * @return string Admin url link with optional path appended
    19481936*/
    1949 function admin_url( $path = '', $scheme = 'admin', $esc_url = true ) {
    1950         return get_admin_url(null, $path, $scheme, $esc_url);
     1937function admin_url( $path = '', $scheme = 'admin' ) {
     1938        return get_admin_url(null, $path, $scheme);
    19511939}
    19521940
     
    19621950 * @return string Admin url link with optional path appended
    19631951*/
    1964 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin', $esc_url = true ) {
     1952function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
    19651953        $url = get_site_url($blog_id, 'wp-admin/', $scheme);
    19661954
     
    19681956                $url .= ltrim($path, '/');
    19691957
    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);
    19761959}
    19771960
     
    19851968 * @return string Includes url link with optional path appended.
    19861969*/
    1987 function includes_url($path = '', $esc_url = true) {
     1970function includes_url($path = '') {
    19881971        $url = site_url() . '/' . WPINC . '/';
    19891972
     
    19911974                $url .= ltrim($path, '/');
    19921975
    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);
    19991977}
    20001978
     
    20081986 * @return string Content url link with optional path appended.
    20091987*/
    2010 function content_url($path = '', $esc_url = true) {
     1988function content_url($path = '') {
    20111989        $url = WP_CONTENT_URL;
    20121990        if ( 0 === strpos($url, 'http') && is_ssl() )
     
    20161994                $url .= '/' . ltrim($path, '/');
    20171995
    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);
    20241997}
    20251998
     
    20352008 * @return string Plugins url link with optional path appended.
    20362009*/
    2037 function plugins_url($path = '', $plugin = '', $esc_url = true) {
     2010function plugins_url($path = '', $plugin = '') {
    20382011
    20392012        $mu_plugin_dir = WPMU_PLUGIN_DIR;
     
    20602033                $url .= '/' . ltrim($path, '/');
    20612034
    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);
    20692036}
    20702037
     
    20832050 * @return string Site url link with optional path appended.
    20842051*/
    2085 function network_site_url( $path = '', $scheme = null, $esc_url = true ) {
     2052function network_site_url( $path = '', $scheme = null ) {
    20862053        global $current_site;
    20872054
     
    21082075                $url .= ltrim($path, '/');
    21092076
    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);
    21162078}
    21172079
     
    21302092 * @return string Home url link with optional path appended.
    21312093*/
    2132 function network_home_url( $path = '', $scheme = null, $esc_url = true ) {
     2094function network_home_url( $path = '', $scheme = null ) {
    21332095        global $current_site;
    21342096
     
    21482110                $url .= ltrim( $path, '/' );
    21492111
    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);
    21562113}
    21572114
     
    21662123 * @return string Admin url link with optional path appended
    21672124*/
    2168 function network_admin_url( $path = '', $scheme = 'admin', $esc_url = true ) {
     2125function network_admin_url( $path = '', $scheme = 'admin' ) {
    21692126        $url = network_site_url('wp-admin/', $scheme);
    21702127
     
    21722129                $url .= ltrim($path, '/');
    21732130
    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);
    21802132}
    21812133
Note: See TracChangeset for help on using the changeset viewer.