-
Remove the action
'wp_save_post_revision'
from'pre_post_update'
. It is set per default inwp-includes/default-filters.php
with the default priority (10). -
Add your own function to this hook. You get the
$post_ID
as parameter, so detecting the post type is easy. -
In your callback copy the code from
wp_save_post_revision()
but use the constantWP_POST_REVISIONS
for the post typepost
only, and use different values for other post types. Not sure if it is possible to pass extra values inregister_post_type()
…
Related Posts:
- Enable revisions for custom post type
- Use register_post_type() to modify an existing post type
- How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only
- Custom post type pagination 404 fix?
- Storing revisions of metadata for custom post type
- Get list of all registered post types slugs
- Post revisions don’t save or show up only for custom post types
- WordPress 4.4+ : How to revision CPT + metadata
- WP_Query ignores post_type in category view
- How to get only posts, pages and custom post types in WordPress
- How do I implement custom fields without using any plugins?
- custom post types don’t appear in RSS
- Why is wp_is_post_revision always false?
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Disable revisions for a specific post type only?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Registered Post Type Isn’t Showing in Admin Menu
- Enabled Revisions to existing custom post type not working WordPress
- wp-types – How to allow custom fields to be saved in the revision
- Multiple post type queries (with specific arguments for each)
- How to retrieve a custom post’s capability?
- Use get_post_types to query only custom posts types
- WP_Query | ‘post_type’ doesn’t work
- How do I get the intended post type of a revision post?
- child of post type (custom)
- WP Storing postmeta into revisions
- How do I set default meta value by post type?
- Limit amount of posts made within a custom taxonomy
- Incorrect post_type in url of taxonomy term
- Only keep the First and Last Revision of a post
- How to define which register_post_status goes to which register_post_type?
- Post author for revision not being set on update/insert
- Is it possible to filter the display name for post formats for display in the Formats meta box?
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- single-{post_type}.php not working
- How to Set Taxonomy Object Description?
- Show only public custom posts in home page
- Can I change my post type to anything and my site still work?
- post_parent in custom post type
- Custom filter for main search: how to exclude specific post_type from search results
- get_post_types – exclude multiple post types by name
- Remove taxonomies using register_post_type_args
- Custom post type and standard post not displaying or working
- post_type internal ID?
- Dynamic pages for linked categories and content
- Custom post type in theme not appearing
- How to copy a custom field from the user’s CPT to the user’s normal posts
- get_post_types not working properly in admin
- Add filter to Admin list for all custom post types by their custom taxonomies
- Post Type => Any conundrum
- How to hide list from custom post type
- Why is my custom post content only viewable when signed into WordPress?
- Show Post Revisions on front-end
- Custom Post Type Single Page is not working
- Get all post types that supports tags
- custom post type single page not found after aotumatic publish By the author’s robot
- Custom post type single with custom URL structure
- Too many revision when post status is changes [duplicate]
- How to mix 2 kinds of post types
- Change Custom Post Type to Post + Category
- Shortcode in excerpt
- How can i order my posts by post type?
- Permanent Custom Post Type
- Custom post type post_type_link gives “page not found” on any other custom post type
- How to set a default CPT template and create post attribute´s display rules?
- Post types showing tables…Can I do that?
- custom post permalink
- do action inside a class is not working
- Updated from 3.8 to 4.2 and all post types changed to “post”
- Pulling in Related Posts based on Post Type array
- How would I get a list of posts from a custom post type
- How can I make a custom post type that loops pages in a new dashboard page, each single page is a new dashboard page (all within the back-end)?
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- How to add post type in masonry posts elementory widget
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- custom taxonomy not return in the code
- Custom post type REST api 404: Updating failed. No route was found matching the URL and request method
- Remove slug from custom post type post URLs
- How to create a custom post type without letting WordPress assign a URL
- Loading custom page template via plugin
- Customize Search to only search current custom post type
- Custom Query to display posts with custom field
- SHOPP Custom Post Type, conditional tags
- Archive page for taxonomy terms
- Custom Post Type Set Comments ON by default without show METABOX
- Adding custom post types to archive
- WordPress CPT save metadata in gutenberg
- url rewriting for custom post types
- Get template part with CPT and Custom Taxonomy conditionals
- Has register_post_type() changed for WordPress 4.0
- Filter in Custom post type to find the parent post
- I want to show post details based on roles user login
- Listing all custom posts having a specific taxonomy whatever the terms
- Create a Hierarchical List of Custom Taxonomies AND Posts
- Making permalink for custom post type/custom taxonomy. Stuck with 404 in the single post
- Delete custom post type metadata without deleting the post in admin area
- Sort by date, then by time
- get_pages can’t load pages with custom post types
- Getting ACF relationship field information
- How to display posts from IMPress for IDX Broker on home page? [closed]