Callback function | WordPress.org

[ad_1]

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.

add_action( 'rest_api_init', function () {

	register_rest_route( 'wp/v2', '/like', array(
		'methods'  => 'POST',
		'callback' => 'handle_like',
	) );

} );

Where i wrong?

Thanks

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer