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
- Update CPT meta data using REST API
- 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?
- WordPress REST Create Post of Custom Type
- Show custom post type endpoint in REST API just if user has capability
- Why is wp_is_post_revision always false?
- 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
- How to create download links based on Custom Fields with Rewrite API
- 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?
- Create custom post with meta field with AJAX and the WordPress REST API
- WordPress API for custom post types returns rest_no_route
- CRUD operations in wordpress
- 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?
- How to see posts in taxonomy endpoint
- 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?
- WordPress custom API endpoint – how to make the request more flexible
- 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 Post Type API doesn’t show taxonomy or category array
- 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?
- How to filter a matched value with custom key using WP REST API?
- 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
- How to Grab Anime info using Jikan API and fill the value in Metabox
- Get Custom Post types data from the API
- How to display “META” array in register_taxonomy
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- register_rest_field update_callback don’t work for $_FILES
- 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
- WP REST API Custom endpoint don’t work in my plugin
- 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
- querying to custom field over ACF REST API
- 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
- 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?
- 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
- How to consume external API from WordPress post editor and display the response data in the custom field?
- Can’t expose custom field to REST API
- Appointment booking system in WordPress
- Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL
- rest_api_init is not getting invoked inside a Class
- Load more post with AJAX
- REST API callback function is not called
- Linking and embedding two custom post types with the REST API
- Ajax load more post button not showing
- Can’t retrieve custom post type taxonomy term to custom post type editor