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”)
- Post current post type to my Ajax
- Enable revisions for custom post type
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- 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
- get post type plural
- 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
- Get the Category Name instead of ID from WP-API
- Disable revisions for a specific post type only?
- Get custom post type REST API not working
- Enabled Revisions to existing custom post type not working WordPress
- How to add custom fields to admin UI and REST API response?
- 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?
- Custom Taxonomy Invalid in REST API
- 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?
- Expose a custom field of a custom post type to the REST API
- Custom post type archive page – Posts overview – with one modal for multiple posts?
- Only keep the First and Last Revision of a post
- WP Rest API – How to get an empty response if query has no posts
- 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
- 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
- Creating tags via API
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- WordPress API for custom post types returns rest_no_route
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- set_query_params using custom params defined in functions file?
- WP API Response does not show my registered metadata
- REST filters only firing when I have a param set
- How do I make reusable content blocks for header and footer when using WordPress headless with another front-end?
- 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 Post Type API doesn’t show taxonomy or category array
- 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)
- 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
- 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?
- URL issue retrieving Custom Post Types using Backbone JS API
- How to add field to custom post type endpoint
- 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
- Create settings page to enable or disable CPT
- YARRP related posts with custom post type and wp-graphql
- Custom plugin contact form connecting to mailchimp API
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- Custom post type REST api 404: Updating failed. No route was found matching the URL and request method
- upload image with rest API to the media library
- Appointment booking system in WordPress
- Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL
- Load more post with AJAX
- REST API callback function is not called
- Can’t retrieve custom post type taxonomy term to custom post type editor
- retrieving external api data and updating existing custom post