On this page
wp_revisions_enabled( WP_Post $post ): bool
Determines whether revisions are enabled for a given post.
Parameters
$postWP_Post Required-
The post object.
Return
bool True if number of revisions to keep isn't zero, false otherwise.
Source
File: wp-includes/revision.php. View all references
function wp_revisions_enabled( $post ) {
return wp_revisions_to_keep( $post ) !== 0;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_revisions_to_keep() wp-includes/revision.php | Determines how many revisions to retain for a given post. |
Used By
| Used By | Description |
|---|---|
| wp_get_latest_revision_id_and_total_count() wp-includes/revision.php | Returns the latest revision ID and count of revisions for a post. |
| wp_get_post_revisions_url() wp-includes/revision.php | Returns the url for viewing and potentially restoring revisions of a given post. |
| _wp_customize_publish_changeset() wp-includes/theme.php | Publishes a snapshot’s changes. |
| WP_REST_Revisions_Controller::get_items() wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php | Gets a collection of revisions. |
| wp_prepare_revisions_for_js() wp-admin/includes/revision.php | Prepare revisions for JavaScript. |
| wp_get_post_revisions() wp-includes/revision.php | Returns all revisions of specified post. |
| wp_save_post_revision() wp-includes/revision.php | Creates a revision for the current version of a post. |
| wp_xmlrpc_server::wp_getRevisions() wp-includes/class-wp-xmlrpc-server.php | Retrieve revisions for a specific post. |
| wp_xmlrpc_server::wp_restoreRevision() wp-includes/class-wp-xmlrpc-server.php | Restore a post revision |
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_revisions_enabled