You can create a custom endpoint using the add_feed
function. I have used this in the past to create custom iCal feeds.
// Initialize the feed
function your_add_custom_feed() {
// This adds a feed http://example.com/?feed=myfeed
add_feed('myfeed', 'your_create_feed');
}
add_action('init','your_add_custom_feed');
// Create a function to form the output
function your_create_feed() {
// Query variables are accessible here ($_GET)
$myvar = get_query_var('myvar');
// You may need to specify the header before output here depending on your type of feed
// header(...)
// Echo your feed here.
}
Related Posts:
- In Gutenberg, now that withAPIData is being deprecated, how can I do an async call to a custom endpoint?
- rewrite endpoint not working on home page
- Rewrite Endpoints not Indexing with google
- Get The latest post from a category
- New endpoint that adds text to end of the file
- How can I use WordPress functions in my stylesheet?
- WordPress Rest API custom endpoint optional param
- Using the Rewrite API to Construct a RESTful URL
- Add extra parameters after permalink?
- Custom Taxonomy Endpoint Pagination using paginate_links()
- Dynamic Endpoints
- Why is my custom API endpoint not working?
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- REST API endpoint for elasticpress autosuggest
- How can I get users email (and additional data) from the rest API?
- Make Two Views of Post Type Archive At Two URLs
- How to stop WP API endpoint from caching?
- WordPress 4.7 REST API endpoints
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- How to: Rest endpoint returning empty object
- Multiple endpoints in one URL
- Custom Endpoint Gives 404 Header
- Sync posts from one WordPress site to another
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- “rest_no_route” – Debug error
- WordPress Rest API – Get all posts based on post_meta on custom endpoint
- how to create endpoint for downloading pdf files?
- How make a multi language routes, with rewrite rules or rewrite endpoints?
- Add extra parameters after permalink?
- Add rewrite rule for rewrite endpoint
- How to have multiple rewrite endpoints in the same URL?
- How to create an endpoint without creating sub endpoints?
- Request object for validate_callback
- Create a php callback/endpoint for an OAuth script
- Query the REST API for a Tag by slug
- Rest API Custom Endpoint with space character
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- Removing “category” from URLs then “add_endpoint()” won’t work…
- add_rewrite_endpoint() and Custom Post Type Archive
- Can’t get POST data in API endpoint callback
- Where to add one custom end point and its function?
- Exclude posts w/ specific post_meta on Rest API endpoint
- Associate the “add_rewrite_endpoint” and “$_GET”
- WP Rest endpoint with custom post type and ACF Fields
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Add Rewrite Endpoint to CPT Archive
- Is there anyway to format my EndPoint URL in WordPress?
- WordPress custom slug (endpoint) and compare all links
- Add sub subpage endpoint in woocommerce
- Woocommerce Customs Endpoint
- Does it still make sense using json endpoint ep_mask now that there’s the new rest api? [closed]
- WP Remote Request not returning all of content via request
- How to force JWT auth for default GET endpoints of WordPress rest api?
- WordPress Rest API custom endpoint for RSS feed
- Using WP-API and SSE not authenticating user ID
- Manage custom post type in woocommerce /my-account/ page
- add_rewrite_endpoint returns 404 on archives
- A case for Hierarchical Custom Posts
- My php header() function is not working [closed]
- Enpoint Not Found in Rewrite Tag Permalink
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- custom endpoints on Custom Post Type return 404 page not found
- Implementing a URL Shortener
- WooCommerce Endpoints content
- Is this a correct usage of ob_start() in my WordPress project?
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- REST Endpoint API 404
- How to fix AWS SNS API end point code that cause site not to load?
- How to add an endpoint for my custom post type? /wp-json/wp/v2/posts is working but it didn’t in the custom post
- AMP version of front page without plugin
- How to add a rewrite endpoint to unattached media?
- Custom Endpoint For Custom Post Type from Child Theme
- WP_REST_Response – How to return Gzip answer and add Content-encoding header?
- Rest API Paginate until all posts are imported
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- REST public POST giving 403 forbidden nginx
- Custom Endpoint For Specific Custom Post Type
- howTo let wordpress endpoint return html-page
- php code for outputting a custom page in my account
- How to add field to custom post type endpoint
- What’s the right way to validate JSON data coming from an AJAX POST request?
- Get UserInfo from WordPress
- Multiple URL rewrite rules and get every prams
- Custom account page that accepts a query parameter
- Update block once an API request returns with a value
- Need to forward Data from WooCommerce Webhook sent to same site WordPress REST API custom endpoint
- Debug info from request handler
- Multiple Permalink Patterns for one page
- How to use endpoint, but remove/rewrite endpoint base?
- Rewrite Endpoint Url without ? before endpoint
- How to use a RewriteRule to change endpoint url
- How to Rewrite WordPress URL for a Plugin
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- Using WordPress.com API to retrieve featured images
- wordpress url rewrite Query Var to Static url
- Securing REST API wp-json/wp/v2/users endpoint
- Custom EndPoint not working when strip child category in URL
- Delete row from table using custom endpoint via API
- Custom rest api endpoint response json problem
- Custom WP rest api endpoint only working on non https?