get_post_to_edit

Gets an existing post and format it for editing.

Description

(object) get_post_to_edit( (int) $id ); 

Returns (object)

Parameters (1)

0. $id (int)
The id.

Usage

  1. if ( !function_exists( 'get_post_to_edit' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/deprecated.php'; 
  3.  
  4. // The id. 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_post_to_edit($id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/deprecated.php  
  1. function get_post_to_edit( $id ) { 
  2. _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' ); 
  3.  
  4. return get_post( $id, OBJECT, 'edit' );