Add tags_input, page_template, and post_category get magic to WP_Post.

Deprecate get_post_to_edit() and wp_get_single_post().
Props scribu
see #21309


git-svn-id: http://core.svn.wordpress.org/trunk@21651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren
2012-08-28 19:08:28 +00:00
parent bdec91100c
commit 52b3f498e6
7 changed files with 99 additions and 86 deletions

View File

@@ -943,7 +943,7 @@ function current_theme_info() {
/**
* This was once used to display an 'Insert into Post' button. Now it is deprecated and stubbed.
*
*
* @deprecated 3.5.0
*/
function _insert_into_post_button( $type ) {
@@ -952,9 +952,25 @@ function _insert_into_post_button( $type ) {
/**
* This was once used to display a media button. Now it is deprecated and stubbed.
*
*
* @deprecated 3.5.0
*/
function _media_button($title, $icon, $type, $id) {
_deprecated_function( __FUNCTION__, '3.5' );
}
/**
* Get an existing post and format it for editing.
*
* @since 2.0.0
* @deprecated 3.5.0
*
* @param int $id
* @return object
*/
function get_post_to_edit( $id ) {
_deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
return get_post( $id, OBJECT, 'edit' );
}

View File

@@ -463,24 +463,6 @@ function get_default_page_to_edit() {
return $page;
}
/**
* Get an existing post and format it for editing.
*
* @since 2.0.0
*
* @param int $id
* @return WP_Post
*/
function get_post_to_edit( $id ) {
$post = get_post( $id, OBJECT, 'edit' );
if ( $post->post_type == 'page' )
$post->page_template = get_post_meta( $id, '_wp_page_template', true );
return $post;
}
/**
* Determine if a post exists based on title, content, and date
*
@@ -928,7 +910,7 @@ function get_available_post_mime_types($type = 'attachment') {
/**
* Executes a query for attachments. An array of WP_Query arguments
* can be passed in, which will override the arguments set by this function.
*
*
* @since 2.5.0
* @uses apply_filters() Calls 'upload_per_page' on posts_per_page argument
*