This is a perfect use case for WordPress’ REST API.
It probably makes sense, to create a custom endpoint, where you can in detail define what results you need. Something along the lines of
<?php
add_action( 'rest_api_init', function () {
register_rest_route( 'kostas_calendar/v1', '/feed/', array(
'methods' => 'GET',
'callback' => 'kostas_calendar_endpoint_feed',
) );
} );
function kostas_calendar_endpoint_feed( WP_REST_Request $request ) {
// your code
}
Related Posts:
- Where to put my code: plugin or functions.php?
- Replace Content of Sidebar on Custom Post Type
- Widget area for individual posts (custom post type)?
- Custom post type not being pulled in widget
- How to Add Custom Taxonomy To Woocommerce Plugin
- Quick edit screen customization
- Mini-Site Strategy
- Prevent trash/delete action on specific post types
- Including Custom Post Types in “Recent Posts” Widget
- Loading custom page template via plugin
- Why The Init Hook For Custom Post Types
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- Render a different post/template from within the template_include action?
- How to use a dedicated template for the Custom Post Type from a plugin?
- How to append text to title of Custom Post Type post (without affecting all titles on page)?
- Use a textarea for a custom post type
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Hierarchical or Non-hierarchical Custom Post Type in Real World Example
- How do I include drag-and-drop in a plugin?
- How could I create a ‘private comments’ section on a custom post type?
- How to create another version of the Category widget?
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- Issue with pre_get_posts on custom post type archive pages
- Get rewrite slug of custom post type in template
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Hook to override title, image and content
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- How to create Blog Post Specific Widget
- No posts found – Custom Post Type show_ui
- Custom page sidebar using Template dropdown box
- WordPress multiple custom post types capability conflict in a single menu
- Add Custom Post type menu to another menu in specific location
- Set a CPT slug as a base name for all the taxonomies
- A custom post type in another post type
- Set Custom Post Type in Widget Settings for use in Widget
- Problems wp_insert_post and save_posts filter
- wordpress remove views from action links in a custom post
- Send a conditional email notification when a custom field value changes in Post Type
- Getting 400 Bad Request on AJAX Call
- Main query not querying any posts in custom taxonomy template
- Show current custom taxonomy
- How to insert data into meta box from another plugin?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- How to get dropdown instance value in WordPress custom Widget
- Methods for development wordpress themes [closed]
- Add post type pages with plugin
- Create a select metabox that the user can pupolate?
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Most viewed post of custom post type
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Mandatory field in Custom post
- Custom post type page with parameter
- Custom post type category link redirecting to 404 page
- Translate website without duplicate custom post
- How to store the third party script with HTML code in the wordpress custom input field?
- How to show the post which checkbox is not selected
- How to upload an image to a custom post type
- Changing CPT permalink
- I have a random letter appearing before my content. Where to start looking for the cause?
- Apply a custom Template to a Custom Post Type from within a plugin
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Error when moving custom post type to bin
- Correct way to register custom post type from external php file?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Add an array as post content dynamically
- Which File Populating CPTs in Slug URL
- Front End users account with lots of user Roles (not Woocommerce)
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- Not Able to List CPT Based on Taxonomy Term
- How to reset HTML filter input fields on CPT list page?
- I want to link an author to everything from any post type that they publish on the website
- Foreach in get_post_types to apply a different filter per post type
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- Simple renaming my custom post type set with a plugin doesn’t work?
- Display custom post type archive on page.php template
- get_post_types doesn’t work in plugin
- Show Templates in Custom Post Type Editor
- Associate custom categories to different user IDs
- Render custom taxonomy query as single template
- How to avoid hardcoded text in a custom page template?
- How to use get_sidebar in plugin folder?
- how to override menu widget?
- Displaying database table in backend of wordpress
- Get term_id for each instance of custom taxonomy
- Resources to learn OOP for WordPress plugins, custom post types, etc
- Filter CPT based on meta box value using Flexible Posts widget?
- Creating Multiple Admin Widget Page with Calling One Sidebar
- Radom post image/link based on custom taxonomy
- Post_type doesn’t work for widgets?
- How to display custom message for (Genesis) featured posts if no posts
- How to create an upload page (front side)
- How to dynamically register custom post type
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- get_post_types() is returning null
- I want to show a list of posts under specified categories
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs