[ Index ] |
WordPress Cross Reference |
[Source view] [Print] [Project Stats]
Post revision functions.
File Size: | 603 lines (17 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
_wp_post_revision_fields( $post = null, $autosave = false ) X-Ref |
Determines which fields of posts are to be saved in revisions. Does two things. If passed a post *array*, it will return a post array ready to be inserted into the posts table as a post revision. Otherwise, returns an array whose keys are the post fields to be saved for post revisions. param: array $post Optional a post array to be processed for insertion as a post revision. param: bool $autosave optional Is the revision an autosave? return: array Post array ready to be inserted as a post revision or array of fields that can be versioned. |
wp_save_post_revision( $post_id ) X-Ref |
Saves an already existing post as a post revision. Typically used immediately after post updates. Adds a copy of the current post as a revision, so latest revision always matches current post param: int $post_id The ID of the post to save as a revision. return: mixed Null or 0 if error, new revision ID, if success. |
wp_get_post_autosave( $post_id, $user_id = 0 ) X-Ref |
Retrieve the autosaved data of the specified post. Returns a post object containing the information that was autosaved for the specified post. If the optional $user_id is passed, returns the autosave for that user otherwise returns the latest autosave. param: int $post_id The post ID. param: int $user_id optional The post author ID. return: object|bool The autosaved data or false on failure or when no autosave exists. |
wp_is_post_revision( $post ) X-Ref |
Determines if the specified post is a revision. param: int|object $post Post ID or post object. return: bool|int False if not a revision, ID of revision's parent otherwise. |
wp_is_post_autosave( $post ) X-Ref |
Determines if the specified post is an autosave. param: int|object $post Post ID or post object. return: bool|int False if not a revision, ID of autosave's parent otherwise |
_wp_put_post_revision( $post = null, $autosave = false ) X-Ref |
Inserts post data into the posts table as a post revision. param: int|object|array $post Post ID, post object OR post array. param: bool $autosave Optional. Is the revision an autosave? return: mixed Null or 0 if error, new revision ID if success. |
wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') X-Ref |
Gets a post revision. param: int|object $post The post ID or object. param: string $output Optional. OBJECT, ARRAY_A, or ARRAY_N. param: string $filter Optional sanitation filter. @see sanitize_post(). return: mixed Null if error or post object if success. |
wp_restore_post_revision( $revision_id, $fields = null ) X-Ref |
Restores a post to the specified revision. Can restore a past revision using all fields of the post revision, or only selected fields. param: int|object $revision_id Revision ID or revision object. param: array $fields Optional. What fields to restore from. Defaults to all. return: mixed Null if error, false if no fields to restore, (int) post ID if success. |
wp_delete_post_revision( $revision_id ) X-Ref |
Deletes a revision. Deletes the row from the posts table corresponding to the specified revision. param: int|object $revision_id Revision ID or revision object. return: mixed Null or WP_Error if error, deleted post if success. |
wp_get_post_revisions( $post_id = 0, $args = null ) X-Ref |
Returns all revisions of specified post. param: int|object $post_id Post ID or post object return: array An array of revisions, or an empty array if none. |
wp_revisions_enabled( $post ) X-Ref |
Determine if revisions are enabled for a given post. param: object $post The post object. return: bool True if number of revisions to keep isn't zero, false otherwise. |
wp_revisions_to_keep( $post ) X-Ref |
Determine how many revisions to retain for a given post. By default, an infinite number of revisions are stored if a post type supports revisions. param: object $post The post object. return: int The number of revisions to keep. |
_set_preview($post) X-Ref |
Sets up the post object for preview based on the post autosave. |
_show_post_preview() X-Ref |
Filters the latest content for preview from the post autosave. |
_wp_preview_terms_filter( $terms, $post_id, $taxonomy ) X-Ref |
Filters terms lookup to set the post format. |
_wp_get_post_revision_version( $revision ) X-Ref |
Gets the post revision version. |
_wp_upgrade_revisions_of_post( $post, $revisions ) X-Ref |
Upgrade the revisions author, add the current post as a revision and set the revisions version to 1 param: object $post Post object param: array $revisions Current revisions of the post return: bool true if the revisions were upgraded, false if problems |
Generated: Tue Mar 25 01:41:18 2014 | WordPress honlapkészítés: online1.hu |