Since the check is made in wp_revisions_to_keep($post)
in wp-includes/revision.php, and the result is run through a filter, you should be able to do something like this:
<?php
function wpse_289553($num, $post) {
if(in_array($post->ID, array(123, 456, 789))) {
return -1;
}
return $num;
}
add_filter("wp_revisions_to_keep", "wpse_289553", 10, 2);
Set your post IDs in that array and adjust the returned number to how many revisions you’d like to keep. -1 means “all of them”.
Related Posts:
- SQL Query for getting all posts in their latest revised state
- Any way to create a revision of a post ONLY with a new button in the Meta Box?
- how to enable different number of revisions for different blogs when using WPMU?
- Get the author of the latest revision
- Adding a cancel button to edit post screen
- How do I batch create revisions of all posts?
- Manually removing revision post types
- Are posts updated or built from revisions + autosaves?
- Define a wordpress constant through plugin functions?
- Post revisions disappeared (for some posts)
- How to hide html tags on revision comparison pages?
- Visual (non-HTML) display of post revisions [closed]
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- Display post changelog in post
- Why my wp_posts data is so huge?
- Delete post revisions only for a single post
- How can I change the date format of the revision list?
- Clean up customize_changeset in DB
- How to get post creation date?
- How do you add Read more … link to posts?
- Get current menu_order
- Setting Custom Sort Order of Posts within a Category
- Display post number not post ID number
- has_archive=false on the default post type
- How do I detach images from posts?
- Exclude drafts in all() view of edit.php
- Change slug with custom field
- How do I use element instead of tags in WordPress post content having webP support?
- adding a custom css class to post
- Prevent duplicate posts in wp_insert_post using custom fields
- How can I allow editors to leave comments on posts that have not yet been published?
- get_post_type_archive_link(‘post’) returns current category archive
- How to activate Markdown in a local installation of WordPress 4.3?
- Check to see if specific loop has less than certain amount of posts
- Single post as homepage?
- Pagination on single post page?
- Random post category URL
- Getting category posts from a certain year
- custom post scheduler for drafts
- Ajaxify This Code
- How do I display some posts fully on the homepage, and some as an excerpt only?
- How to bulk add vast amounts of posts
- 301 (static page instead latest posts)
- Transferring WordPress Database – Serialised data
- Users problem (multi-author plus multisite)
- Filter only the text in the_content
- Saving custom fields to a custom taxonomy
- Show posts count for Categories and Tags in wp_nav_menu
- How to WP_Query() from multiple blogs and order them?
- How to get subcategories from category slug?
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- How to check if a post is published today?
- How can I add a class to particular paragraphs in my post?
- Conflict array_splice on loop and query in widget
- How to have one page show posts reverse-chronologically, but the others chronologically?
- wp_insert_post not working fine
- How come this loop is not working? [closed]
- Change default post style to columns
- Link from Post to Another Post Via Clicking on Words within Original Post
- What’s a theme that properly handles previews of different types of posts?
- Using the loop to set locations for all posts on a single google map
- Insert JavaScript in a blog post or a new page?
- A better code for no post format?
- WordPress, custom post type and posts query help!
- Order buttons added to TinyMCE
- How to create a clickable latest posts list?
- How to create loop of posts except post ID defined via ACF field
- Tag for custom post type
- how to put post customized in page
- How to display particular categorie’s post which associated to specific user?
- How to delete/customize imported demo content from a theme or add my own?
- Post title spoiler how?
- how to print total number of posts filtered by category?
- How to display post excerpt beside post list inside Post of Dashboard
- Integrate video and iframe in a post type gallery
- Add a unique meta desciption
- Displaying a specific sub-category’s posts from wp_query
- Filter question list on substring of metavalue
- Embedding Facebook in blog post not working
- Get results from the main wp_query
- Comment Authors of Post On Front Page
- How to list all names and descriptions of a custom taxonomy
- WordPress Media URLs?
- Pagination for custom query won’t let me back on page 1
- Make a custom URL and link to custom Template
- How to get all post titles starting with numbers and symbols?
- How to inject a post within a loop
- thumbnail image path and file path for gallery thumbnail images
- How to display a certain template element only for posts published within certain time range?
- List direct children of page
- Unable to get posts with category on my page
- How to set value in Query Loop?
- Wp_query WooCommerce products
- No matching template found when using single.php
- WP Rest API feature image breaking react component
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Inserting Media on New Post But Hides Previous Uploads for Editor/Contributor
- I have a website issue I am trying to resolve