Make WordPress Core

Changeset 14372


Ignore:
Timestamp:
05/03/2010 01:56:35 PM (14 years ago)
Author:
westi
Message:

Fix the edit post link to cope with the change in behaviour of admin_url to always escape the url. See #13051.

File:
1 edited

Legend:

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

    r14347 r14372  
    785785        return;
    786786
    787     if ( 'display' == $context )
    788         $action = '&action=edit';
    789     else
    790         $action = '&action=edit';
    791 
    792787    $post_type_object = get_post_type_object( $post->post_type );
    793788    if ( !$post_type_object )
     
    797792        return;
    798793
    799     return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID) ), $post->ID, $context );
     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 );
    800802}
    801803
Note: See TracChangeset for help on using the changeset viewer.