Compare first and last post revision
Sorry I didn’t notice the “compare two revisions” button in “revisions”
Sorry I didn’t notice the “compare two revisions” button in “revisions”
Figured it out, after half a day of banging away and asking a team mate. In the wpscholar link above I changed this line of code. // Surface all Gutenberg blocks in the WordPress REST API $post_types = get_post_types_by_support( [ ‘editor’ ] ); // change this line $post_types = [‘post’, ‘page’, ‘post-revision’]; // to this … Read more
From the Revisions documentation page: Revisions are stored in the posts table. Revisions are stored as children of their associated post (the same thing we do for attachments). They are given a post_status of inherit, a post_type of revision, and a post_name of {parent ID}- revision(-#) for regular revisions and {parent ID}-autosave for autosaves. So … Read more
I used to disable the Gutenberg with this: //disable gutenburg add_filter(‘use_block_editor_for_post’, ‘__return_false’, 10); This filter disables the Gutenberg sitewide but it doesn’t work smoothly in other custom-post-types. Not only the revisions but other features are also hidden on the post edit screen of custom-post-types. Changing this to the post type filter works smoothly across all … Read more
The solution was to generate and use an API token. in WP admin, go to user and generate the key take that key and glue it with the username it is generated with in this format: username:key base64 encode that string put that base64 value into the header: ‘Authorization’: ‘Basic <base64 token here>’ In my … Read more
Please take database backup and run a below MYSQL query and check is this helpful: DELETE FROM wp_posts WHERE post_type = “revision” AND ID NOT IN(SELECT ID FROM wp_posts WHERE post_type=”revision” ORDER BY ID DESC LIMIT 5)
You can filter the output like bellow: <?php /** * @param $revision_date_author * @param $revision * @param $link * @return mixed */ function filter_wp_post_revision_title_expanded( $revision_date_author, $revision, $link ) { $revision = get_post( $revision ); if ( ! $revision ) { return $revision; } if ( ! in_array( $revision->post_type, array( ‘post’, ‘page’, ‘revision’ ), true ) … Read more
Show Post Revisions on front-end
Problem with revisions only returning four results
how long do restored versions take to go live?