By searching a lot to API documentation, I found the solution to my problem finally:
function my_rest_prepare_post( $prepared_post, $request ) {
...
}
add_filter( 'rest_pre_insert_posttype', 'my_rest_prepare_post', 10, 3 );
Related Posts:
- How to Debug the ‘save_post’ Action?
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- ACF for custom post type archive pages: which hook to use?
- Filter Content on all Post Types
- Order Custom Post Type by Custom Field Value
- Retrieve custom field from Contact Form 7 [closed]
- Query Custom Post Type Taxonomy term with multiple parameters
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- How to query WordPress posts bycustom field with a max characters’ length
- The loop seems stuck to a single (now deleted) post
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- How to update post meta on uploaded image from a custom form?
- How to group posts and get a mixed posts and groups view?
- Filter Posts from the Main Query
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- Multiple Frontend Filters Using Advanced Custom Fields
- Integrate Custom Post Type Events into Calendar
- Specific routing for CPT
- Order post by date with ACF
- Displaying custom field according to date
- don’t publish custom post type post if a meta data field isn’t valid
- How to set the seo title tag on a page by page basis?
- WebP Fallback for Inline Background Image in Style Attribute
- Adavnced custom fields relationship query plus query inside
- Query based on custom fields start and end date
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- Categorise Custom Post Types
- Advanced custom field boolean value in custom post type
- How can I add a filter to a particular post format?
- Can a shortcode included in post content add styles to the ?
- Is there any way to get list of all possible filter hooks for all post types?
- Why is my WP Query not returning first result’s post meta?
- Add a custom text to admin footer in a Custom Post Type page
- How to add/edit advanced custom fields on custom post type’s WordPress REST API?
- Get rid of “trash can” for custom post type
- Recoverable Fatal Error – Object of class WP_Post could not be converted to string
- Querying & displaying custom post type into an existent page [closed]
- How to get a custom type post data when it has a connection with another custom type post?
- Custom post type showing same Post on all Pages
- Why would social icon badges disappear after adding a custom post type?
- Sort a custom post with ACF: Date Picker & Display Featured!
- Use remove_meta_box conditionally on custom post type
- ACF repeater field usage
- Custom Meta fields Update hook?
- List of users that clicked a ‘Join’ button at single post
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- Add an Outside Wrapper to my Header and Make it Full Width
- Post loop count is not in order
- How to inherit field value from parent post into in child / sub post
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- sortable columns for multiple custom post types not working
- Custom Post Type page sorts differently on different environments
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- How check if a post is saved from backend or frontend?
- set_query_params using custom params defined in functions file?
- Custome fields not displayed
- How to build a WordPress post review system beside commenting
- WordPress hook after post content and meta update
- Create short URL with auto 301 redirect
- How to define the template for custom posts?
- WordPress hook which triggers on post import
- Assigning alternate single-{cpt} template based on blog_id in multisite
- providing access to post_id or post inside functions.php
- Batch Extract Date from post title and put into ACF custom field
- Before saving post hook
- Query entries from custom post type in an ACF flexible content field
- Why is wp api returning old acf values?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Distribute Custom Post in different pages
- get custom post type value in header.php [closed]
- posttype and custom fields on multisite
- How do I get_the_postID() for a custom post that uses ACF repeater field?
- How do I replace the post title with a custom field?
- Advanced custom fields Post Object image field not displaying in custom post type single.php
- Sum and count of custom field values
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- How to export custom post type with ACF to individual file with automation?
- Custom fields not showing in custom post type
- Creating alternate meta box context locations
- Group by custom field value (start and end times)
- Custom post types, disable fields
- meta query not retrieving posts
- Custom Post Type with Configurable Sidebar via ACF
- Make a custom column sortable by a value from a different custom post type
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- wordpress post_where set only for my costum post type
- Set Default Option Value as Blank for Meta Box
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- ACF Relationship Posts how to show additional content
- wp-includes does not contain a feed template
- Using WP meta query to show custom post types by a start and finish date
- Limit search field to just search a custom post type with custom fields
- comments hooks on custom post type
- Advanced custom field – posted fields from custom post type
- Catch and display error on save_post action
- Excerpt length: get first paragraph
- SQL query – get ids – Advanced Custom Fields / WPeC
- Custom field with Types: get custom field’s value label (of type select)
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?