Post revisions have the original post as their parent, so you can get the post type by checking the post type of the revision’s parent:
$revision = wp_get_post_revision( $id );
$post_type = get_post_type( $revision->post_parent );
Related Posts:
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- REST API: How can I restrict a custom post type to only be accessible by authenticated users?
- Exclude objects from WordPress API based from ACF field using rest_prepare_{$post_type}
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- Enable revisions for custom post type
- How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only
- Custom post types filtered by taxonomy using REST API v2
- Storing revisions of metadata for custom post type
- Per Post Type Revision Numbers
- Post revisions don’t save or show up only for custom post types
- Update CPT meta data using REST API
- WordPress 4.4+ : How to revision CPT + metadata
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Show custom post type endpoint in REST API just if user has capability
- WP Rest API Querying Custom Posts by ACF fields
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- How to get dynamically custom post type that are under a certain category
- How to create download links based on Custom Fields with Rewrite API
- Disable revisions for a specific post type only?
- Enabled Revisions to existing custom post type not working WordPress
- How to add custom fields to admin UI and REST API response?
- WordPress Rest API only returns content when posttype has editor capability
- Custom search with Custom Fields in WP REST API?
- Wp Rest API request posts from a custom taxonomy
- Recommended way to remove WP REST API returned data for custom post
- wp-types – How to allow custom fields to be saved in the revision
- Custom Post Type and API REST is not working
- React post to WordPress custom post type
- How would you associate location data with a post?
- Custom Post-to-Post with multiple parents?
- Custom Post type with ACF in REST API, how do I get those values?
- is_main_query() not working for WP REST API
- Very simple wordpress block to display posts from an api call
- Add custom parameter to REST API request of a custom post type?
- Using The REST API How To Pull All Custom Posts?
- Cannot add custom field to “orderby” parameter in Rest API
- Make parts of your wordpress website completely built with data from external APIs?
- Getting meta in editor plugin, and event triggering issue
- WP Storing postmeta into revisions
- Database to page routing API?
- How to create custom post by using REST API securely?
- Only keep the First and Last Revision of a post
- Callback to custom field is not working in WordPress REST API
- Custom Post Type not showing in Rest API on Multisite
- post meta parameter in post custom-post-type endpoint with restapi
- filter custom post in rest api with custom function
- API Rest Custom Post Type doesn’t return all data
- Custom REST endpoints for a custom post type with custom fields
- Post author for revision not being set on update/insert
- Pros and cons of a custom page vs custom post type template file
- Creating tags via API
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- How to get all post of custom post type by rest api?
- WordPress API for custom post types returns rest_no_route
- set_query_params using custom params defined in functions file?
- How to see posts in taxonomy endpoint
- WP API Response does not show my registered metadata
- How do I make reusable content blocks for header and footer when using WordPress headless with another front-end?
- How to add a filter to a custom post type to get adjacent custom posts via the REST API
- How to handle new post from API request?
- wp-json API: not logged in when clicking link to the API from admin mode
- WordPress as a backend for external service? [closed]
- Custom permalink structure for remote content pages
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- How to make an API call to a custom post type but filtering by meta value?
- Fetching custom post type without knowing post type (REST API)
- WordPress REST API V2: “{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one.”
- no_rest_route in Unit Testing for REST endpoint for CPT registered via show_in_rest
- How can I create new CustomPostType record using wp.api.collections?
- Custom endpoint filtering post by custom taxonomies
- wp rest api orderby field in a custom table
- Show Post Revisions on front-end
- Sync posts via JSON API
- How To Read Read Custom Post Type Data in Headless CMS Mode
- WP_Query: how to search tags in addition to a custom post type?
- How can I sort the results of a REST API response by the title of a connected custom post type?
- URL issue retrieving Custom Post Types using Backbone JS API
- How to add field to custom post type endpoint
- Create API’s for custom-post types & custom queries using REST or Graphql
- Action on Custom Post publish
- Use a template for a specific url slug without creating a page
- localize_script or rest api
- Issue with CPT posts within WP REST API showing as []
- Populating Custom Fields from live JSON
- Too many revision when post status is changes [duplicate]
- Saving custom post types post_meta over REST-API fails
- filter rest api post by a acf filed
- How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?
- WordPress API only returning HTML
- Insert custom post data in to MailChimp campaign email
- wp_insert_post not working for custom post type?
- How to dynamically register custom post type
- Store custom post type with JSON content
- YARRP related posts with custom post type and wp-graphql
- Custom plugin contact form connecting to mailchimp API
- Get all posts of any post type in a category from REST API
- display posts, pages and custom post types from another wordpress site
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- upload image with rest API to the media library
- How to consume external API from WordPress post editor and display the response data in the custom field?