[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> revision.php (summary)

Post revision functions.

File Size: 771 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 19 functions

  _wp_post_revision_fields()
  _wp_post_revision_data()
  wp_save_post_revision()
  wp_get_post_autosave()
  wp_is_post_revision()
  wp_is_post_autosave()
  _wp_put_post_revision()
  wp_get_post_revision()
  wp_restore_post_revision()
  wp_delete_post_revision()
  wp_get_post_revisions()
  wp_revisions_enabled()
  wp_revisions_to_keep()
  _set_preview()
  _show_post_preview()
  _wp_preview_terms_filter()
  _wp_preview_post_thumbnail_filter()
  _wp_get_post_revision_version()
  _wp_upgrade_revisions_of_post()

Functions
Functions that are not part of a class:

_wp_post_revision_fields( $post = array()   X-Ref
Determines which fields of posts are to be saved in revisions.

param: array|WP_Post $post       Optional. A post array or a WP_Post object being processed
param: bool          $deprecated Not used.
return: array Array of fields that can be versioned.

_wp_post_revision_data( $post = array()   X-Ref
Returns a post array ready to be inserted into the posts table as a post revision.

param: array|WP_Post $post     Optional. A post array or a WP_Post object to be processed
param: bool          $autosave Optional. Is the revision an autosave? Default false.
return: array Post array ready to be inserted as a post revision.

wp_save_post_revision( $post_id )   X-Ref
Creates a revision for the current version of a post.

Typically used immediately after a post update, as every update is a revision,
and the most recent revision always matches the current post.

param: int $post_id The ID of the post to save as a revision.
return: int|WP_Error|void Void 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: WP_Post|false 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|WP_Post $post Post ID or post object.
return: false|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|WP_Post $post Post ID or post object.
return: false|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|WP_Post|array|null $post     Post ID, post object OR post array.
param: bool                   $autosave Optional. Is the revision an autosave?
return: int|WP_Error WP_Error 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|WP_Post $post   The post ID or object.
param: string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
param: string      $filter Optional sanitation filter. See sanitize_post().
return: WP_Post|array|null WP_Post (or array) on success, or null on failure.

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|WP_Post $revision_id Revision ID or revision object.
param: array       $fields      Optional. What fields to restore from. Defaults to all.
return: int|false|null 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|WP_Post $revision_id Revision ID or revision object.
return: array|false|WP_Post|WP_Error|null 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|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
param: array|null  $args    Optional. Arguments for retrieving post revisions. Default null.
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: WP_Post $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 kept.

The constant WP_POST_REVISIONS can be set in wp-config to specify the limit
of revisions to keep.

param: WP_Post $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.

param: WP_Post $post
return: WP_Post|false

_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.

param: array  $terms
param: int    $post_id
param: string $taxonomy
return: array

_wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key )   X-Ref
Filters post thumbnail lookup to set the post thumbnail.

param: null|array|string $value    The value to return - a single metadata value, or an array of values.
param: int               $post_id  Post ID.
param: string            $meta_key Meta key.
return: null|array The default return value or the post thumbnail meta array.

_wp_get_post_revision_version( $revision )   X-Ref
Gets the post revision version.

param: WP_Post $revision
return: int|false

_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: WP_Post $post      Post object
param: array   $revisions Current revisions of the post
return: bool true if the revisions were upgraded, false if problems



Generated: Mon Feb 18 08:20:01 2019 Cross-referenced by PHPXref 0.7