WordPress REST API Custom Endpoint with URL Parameter
问题 I am trying to create a custom endpoint for the WordPress REST API and pass parameters through the URL. The endpoint currently is: /wp-json/v1/products/81838240219 What I am trying to achieve is an endpoint that looks like this and being able to retrieve the identifier parameter in the callback. /wp-json/v1/products?identifier=81838240219 // Custom api endpoint test function my_awesome_func( $data ) { $identifier = get_query_var( 'identifier' ); return $identifier; } add_action( 'rest_api