Title: Callback function
Last modified: February 13, 2023

---

# Callback function

 *  Resolved [alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * (@alfredovilla)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/)
 * Hi, i need to make a callback function for a POST API REST to a custom taxonomy
   make with PODS.
 * The API REST is active for all fields of the custom taxonomy.
 * I made this code for the callback call but i dont receive the POST data.
 *     ```wp-block-code
       add_action( 'rest_api_init', function () {
   
       	register_rest_route( 'wp/v2', '/like', array(
       		'methods'  => 'POST',
       		'callback' => 'handle_like',
       	) );
   
       } );
       ```
   
 * Where i wrong?
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/#post-16466352)
 * Hi [@alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * I see you’ve made the route but where/how are you calling this route?
   POST params
   are provided with the call depending on what you use.
 * Cheers, Jory
 *  Thread Starter [alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * (@alfredovilla)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/#post-16466390)
 * Hi [@keraweb](https://wordpress.org/support/users/keraweb/),
 * I’ve inserted the route in the functions file of current theme with callback 
   function named ‘handle_like’:
 *     ```wp-block-code
       function handle_like( WP_REST_Request $request ) {....
       ```
   
 * I send a test POST API with Postman to the same route address …./wp-json/wp/v2/
   like with the parameters that i want to elbaorate with ‘handle_like’ function,
   but nothing the data comes only without my custom route….
    -  This reply was modified 3 years, 3 months ago by [alfredovilla](https://wordpress.org/support/users/alfredovilla/).
    -  This reply was modified 3 years, 3 months ago by [alfredovilla](https://wordpress.org/support/users/alfredovilla/).
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/#post-16466458)
 * Hi [@alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * This might be related: [https://stackoverflow.com/questions/41362277/wp-rest-api-custom-end-point-post-request](https://stackoverflow.com/questions/41362277/wp-rest-api-custom-end-point-post-request)
 * In any case, this isn’t Pods related, you might have more luck on the general
   WordPress forums!
 * Cheers, Jory
 *  Thread Starter [alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * (@alfredovilla)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/#post-16466682)
 * Thanks [@keraweb](https://wordpress.org/support/users/keraweb/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Callback function’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [alfredovilla](https://wordpress.org/support/users/alfredovilla/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/callback-function-9/#post-16466682)
 * Status: resolved