How can I secure my custom rest api endpoint or add under a already existing rest group
How can I secure my custom rest api endpoint or add under a already existing rest group
How can I secure my custom rest api endpoint or add under a already existing rest group
I figured it out by reading up the React docs. Now I use the edit component’s own state to store the media file retrieved from REST, and the function to make the REST request is now within the edit component. I don’t need a withSelect any more. This is a nicer approach to the one … Read more
That add_rewrite_endpoint(“scheduled-order-create/([0-9]+)/?”, …); doesn’t work because add_rewrite_endpoint() doesn’t work with custom RegEx pattern. And remember that in addition to default public query vars like cat, tag, year and author, WordPress also makes all public post types and taxonomies (with a non-empty query_var value when registered — see register_post_type() and register_taxonomy()) be readable from the URL … Read more
See this is sort of solved in the comments and old but to save someone going down the wrong path here, I believe this is done the wrong way for OP to achieve what they want. One re-write rule should be enough here, and then use the matches to construct your query. Firstly, we need … Read more
WordPress – replicate same globals, query vars and query for an alternate endpoint
Since you’re using a JWT for the current user (that is logged into WordPress), you can use this endpoint: /wp/v2/users/me https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user-2 You can also check the token to see what claims are available at https://jwt.ms
What’s the right way to validate JSON data coming from an AJAX POST request?
How to add field to custom post type endpoint
Check this one: How to add a new endpoint in woocommerce Update In your callback function include your extended template page because output is expected. ex: function foren_content() { include(‘woocommerce/myaccount/custom-page.php’); } Then inside custom-page.php call the desired content with get_post(ID) or if you have your endpoint registerd in woocommerce settings call it by slug. The … Read more
howTo let wordpress endpoint return html-page