Actually I found my answer after diving into the WordPress’s core code.
Yes, it is possible to do such a thing, all you need is to use the following function:
register_rest_route
There are some tricky parts though. This function uses regular expressions and now I am going to figure out how to use that in this function.
Related Posts:
- How to add custom fields to admin UI and REST API response?
- Custom search with Custom Fields in WP REST API?
- Cannot add custom field to “orderby” parameter in Rest API
- Callback to custom field is not working in WordPress REST API
- filter custom post in rest api with custom function
- Create custom post with meta field with AJAX and the WordPress REST API
- How to make an API call to a custom post type but filtering by meta value?
- How To Read Read Custom Post Type Data in Headless CMS Mode
- 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
- 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?
- querying to custom field over ACF REST API
- How do I set the default admin sort order for a custom post type to a custom column?
- How can I change the admin search posts fields?
- Development of a WordPress Search Plugin – Best Practices
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- WordPress 4.4+ : How to revision CPT + metadata
- WP_Query orderby custom field then post_date in one query
- Using Custom Fields in Custom Post Type URL
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Adding meta values to permalink
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- Custom field being erased after autosave
- How to select one major category (or custom taxonomy) for a custom post type?
- front end radio custom taxonomy with custom post type
- How to get source of custom meta image?
- Displaying Meta Box Image
- Display posts if a custom field value is equal to another custom field value
- Custom field default value with counter
- How to use custom fields to enable sticky posts on custom post types?
- Custom meta fields for specific custom type only
- Custom Fields vs Separate Table
- Check if a specific custom field exists?
- WordPress Create Post from front-end
- How to insert content from another Custom Post type into Post?
- Using several custom fields as custom post title
- How to bulk copy custom fields between custom posts?
- Calculate all custom field values in the post loop
- add custom field to custom post type
- Get image post ID in media upload
- Role scoping for contributors down to the field level
- Having unique constraints for custom fields in a custom post type
- Display custom fields from custom posts in RSS feed
- A better way to add a meta box to custom post types
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Cannot save CPT meta box
- custom comments form for custom post type
- Custom post type’s extra fields – how to handle?
- Enable Custom Fields For Custom Post Type When CPT Created Using Plugin
- WordPress API for custom post types returns rest_no_route
- Submitting Custom Post Types with custom fields from Front-end form
- post_per_page ignored in WP_Query
- finding and using post type fields in WordPress
- Sort custom post type by most current date picker
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Remove default WYSIWYG editor without removing custom fields editors
- Display custom meta on page that has been check in custom post type
- How do I update_post_meta() or add_post_meta() with an AJAX call
- Filtering Custom Post Type by Comparing Date and Two Meta Keys
- How to prevent meta data from being edited in a post?
- Automatically add a character to field in edit post page
- Change Post Meta via AJAX from the posts list table
- How to keep a record of changes to a custom field?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Saving metabox keys and storing values as array
- Mandatory field in Custom post
- Update value inside array update_post_meta
- WP query_posts group by meta field related
- How to store the third party script with HTML code in the wordpress custom input field?
- WP Query from two Custom Post type fields as statement
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- How to upload an image to a custom post type
- How to display custom field in product description?
- Add custom template ‘sub-page’ to Custom Post type?
- Where is get_post_meta value located?
- Adding a Section for Visitors
- Automatic Set Category For A Custom Post Type
- Confused about where to store my data
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- WordPress loop, show only one post per custom field
- one get_posts to return a number of custom posts for each meta value
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- Custom Post Type as invoice or order template
- Get result from Custom Field in Custom Post type
- Make each Value of custom field show related posts when clicked
- Filter CPT based on meta box value using Flexible Posts widget?
- Advanced search form with filters for custom taxonomies and custom fields
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Filter Custom post type by another Custom post type
- How to get lowest price from custom fields of posts
- Retrieve a post with its ACF repeater fields in wordpress
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Display ACF object field data using Elementor Custom Query
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- WordPress custom field sorting, weird behavior: the latest post is at the end
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes