Created
December 29, 2016 15:48
-
-
Save circlecube/cd8a1a3d8eabe3307bd5bb887bbb1868 to your computer and use it in GitHub Desktop.
WillyMelt API Tweaks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add custom fields query to WP REST API v2 | |
// https://1fix.io/blog/2015/07/20/query-vars-wp-api/ | |
function my_allow_meta_query( $valid_vars ) { | |
$valid_vars = array_merge( $valid_vars, array( 'meta_key', 'meta_value' ) ); | |
return $valid_vars; | |
} | |
add_filter( 'rest_query_vars', 'my_allow_meta_query' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment