wp_restore_post_revision( int|WP_Post $revision_id, array $fields = null )

Restores a post to the specified revision.

9 related functions found for: wp_restore_post_revision

Top ↑

Related terms found for this post

wp-parser-related-wordspost, post-typ, post-type, restor, restore, revis, revision, revision-php, wp-includes, wp-restore
wp-parser-packagePost_Revisions, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • post
  • Post_Revisions
  • post-typ
  • post-type
  • restor
  • restore
  • revis
  • revision
  • revision-php
  • wp-includes
  • wp-includes/revision.php
  • wp-restore

Top ↑

Description Description

Can restore a past revision using all fields of the post revision, or only selected fields.

Top ↑

Parameters Parameters


(int|WP_Post) (Required) Revision ID or revision object.


(array) (Optional) What fields to restore from. Defaults to all.

Default value: null

Top ↑

Return Return

(int|false|null) Null if error, false if no fields to restore, (int) post ID if success.

Top ↑

Source Source

File: wp-includes/revision.php


Top ↑

Changelog Changelog

Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.