New answers tagged

0

what about WP REST API V2? I think this is not working on v2! add_filter('json_query_var-meta_query', 'adjustQrry', 10, 1); should it be like this? add_filter('rest_query_vars-meta_query', 'adjustQrry', 10, 1);


0

I got it. Turns out the tutorial I was looking at was old and I was using the wrong WP function. I was using register_api_field but the correct one to use is register_rest_field. It goes like this... function facebook_add_user_data() { register_rest_field( 'user', 'facebook', array( 'get_callback' => 'rest_get_user_field', ...


-1

Try /wp-json/wp/v2/pages/<id>. Not sure if retrieving a page by name is possible using the REST API.



Top 50 recent answers are included