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.

Built from https://develop.svn.wordpress.org/trunk@33659


git-svn-id: http://core.svn.wordpress.org/trunk@33626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-20 06:24:26 +00:00
parent 1fd0dcbc9e
commit 45fc6a3def
4 changed files with 20 additions and 21 deletions

View File

@ -760,7 +760,7 @@ class wp_xmlrpc_server extends IXR_Server {
'post_content' => $post['post_content'], 'post_content' => $post['post_content'],
'post_parent' => strval( $post['post_parent'] ), 'post_parent' => strval( $post['post_parent'] ),
'post_mime_type' => $post['post_mime_type'], 'post_mime_type' => $post['post_mime_type'],
'link' => post_permalink( $post['ID'] ), 'link' => get_permalink( $post['ID'] ),
'guid' => $post['guid'], 'guid' => $post['guid'],
'menu_order' => intval( $post['menu_order'] ), 'menu_order' => intval( $post['menu_order'] ),
'comment_status' => $post['comment_status'], 'comment_status' => $post['comment_status'],
@ -930,7 +930,7 @@ class wp_xmlrpc_server extends IXR_Server {
protected function _prepare_page( $page ) { protected function _prepare_page( $page ) {
// Get all of the page content and link. // Get all of the page content and link.
$full_page = get_extended( $page->post_content ); $full_page = get_extended( $page->post_content );
$link = post_permalink( $page->ID ); $link = get_permalink( $page->ID );
// Get info the page parent if there is one. // Get info the page parent if there is one.
$parent_title = ""; $parent_title = "";
@ -5383,7 +5383,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
$post = get_extended($postdata['post_content']); $post = get_extended($postdata['post_content']);
$link = post_permalink($postdata['ID']); $link = get_permalink($postdata['ID']);
// Get the author info. // Get the author info.
$author = get_userdata($postdata['post_author']); $author = get_userdata($postdata['post_author']);
@ -5523,7 +5523,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
$post = get_extended($entry['post_content']); $post = get_extended($entry['post_content']);
$link = post_permalink($entry['ID']); $link = get_permalink($entry['ID']);
// Get the post author info. // Get the post author info.
$author = get_userdata($entry['post_author']); $author = get_userdata($entry['post_author']);

View File

@ -3636,3 +3636,18 @@ function wp_htmledit_pre($output) {
return apply_filters( 'htmledit_pre', $output ); return apply_filters( 'htmledit_pre', $output );
} }
/**
* Retrieve permalink from post ID.
*
* @since 1.0.0
* @deprecated 4.4.0
*
* @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
* @return string|false
*/
function post_permalink( $post_id = 0 ) {
_deprecated_function( __FUNCTION__, '4.4', 'get_permalink()' );
return get_permalink( $post_id );
}

View File

@ -288,22 +288,6 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample ); return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample );
} }
/**
* Retrieve permalink from post ID.
*
* @since 1.0.0
*
* @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
* @param mixed $deprecated Not used.
* @return string|false
*/
function post_permalink( $post_id = 0, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
return get_permalink($post_id);
}
/** /**
* Retrieve the permalink for current page or page ID. * Retrieve the permalink for current page or page ID.
* *

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-33658'; $wp_version = '4.4-alpha-33659';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.