Make WordPress Core

Changeset 33659


Ignore:
Timestamp:
08/20/2015 06:24:00 AM (9 years ago)
Author:
wonderboymusic
Message:

Deprecate post_permalink() (Introduced in 1.0, already had a deprecated argument in 1.3), which just wraps get_permalink() and was only used by XML-RPC in 4 places.

Props solarissmoke.
Fixes #16982.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r33612 r33659  
    761761            'post_parent'       => strval( $post['post_parent'] ),
    762762            'post_mime_type'    => $post['post_mime_type'],
    763             'link'              => post_permalink( $post['ID'] ),
     763            'link'              => get_permalink( $post['ID'] ),
    764764            'guid'              => $post['guid'],
    765765            'menu_order'        => intval( $post['menu_order'] ),
     
    931931        // Get all of the page content and link.
    932932        $full_page = get_extended( $page->post_content );
    933         $link = post_permalink( $page->ID );
     933        $link = get_permalink( $page->ID );
    934934
    935935        // Get info the page parent if there is one.
     
    53845384
    53855385            $post = get_extended($postdata['post_content']);
    5386             $link = post_permalink($postdata['ID']);
     5386            $link = get_permalink($postdata['ID']);
    53875387
    53885388            // Get the author info.
     
    55245524
    55255525            $post = get_extended($entry['post_content']);
    5526             $link = post_permalink($entry['ID']);
     5526            $link = get_permalink($entry['ID']);
    55275527
    55285528            // Get the post author info.
  • trunk/src/wp-includes/deprecated.php

    r33492 r33659  
    36373637}
    36383638
     3639/**
     3640 * Retrieve permalink from post ID.
     3641 *
     3642 * @since 1.0.0
     3643 * @deprecated 4.4.0
     3644 *
     3645 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
     3646 * @return string|false
     3647 */
     3648function post_permalink( $post_id = 0 ) {
     3649    _deprecated_function( __FUNCTION__, '4.4', 'get_permalink()' );
     3650
     3651    return get_permalink( $post_id );
     3652}
     3653
  • trunk/src/wp-includes/link-template.php

    r32964 r33659  
    287287     */
    288288    return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );
    289 }
    290 
    291 /**
    292  * Retrieve permalink from post ID.
    293  *
    294  * @since 1.0.0
    295  *
    296  * @param int|WP_Post $post_id    Optional. Post ID or WP_Post object. Default is global $post.
    297  * @param mixed       $deprecated Not used.
    298  * @return string|false
    299  */
    300 function post_permalink( $post_id = 0, $deprecated = '' ) {
    301     if ( !empty( $deprecated ) )
    302         _deprecated_argument( __FUNCTION__, '1.3' );
    303 
    304     return get_permalink($post_id);
    305289}
    306290
Note: See TracChangeset for help on using the changeset viewer.