Puts all json code from posts api.
Author: | Maher Samy (profile at wordpress.org) |
WordPress version required: | 1.0.1 |
WordPress version tested: | 4.6.1 |
Plugin version: | 1.0.1 |
Added to WordPress repository: | 29-10-2016 |
Last updated: | 01-11-2016
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 0 |
Rated by: | 0 |
Plugin URI: | https://wordpress.org/plugins/aliens-sci/ |
Total downloads: | 727 |
Click to start download
|
FAQ
requires you to add the following to your functions.php file to allow filtering on the WP-API by meta_key
add_filter( ‘json_query_vars’, ‘filterJsonQueryVars’ );
function filterJsonQueryVars( $vars ) { $vars[] = ‘meta_key’; return $vars; }
Once you added that, you can filter using these arguments
dowmian.com/wp-json/posts?filter[orderby]=meta_value_num&filter[meta_key]=order&filter[order]=ASC
Usage
filter[orderby]: Either meta_value or meta_value_num depending on whether you’re filtering on an alphanumeric value or a numeric value filter[meta_key]: The key you want to filter on, this is the name of the ACF field filter[order]: The order to receive the data in, ASC or DESC
See the CONTRIBUTING.md
file.
How can I filter posts on a custom field?
ChangeLog
1.0.0
1.0.1
- Bug fixes and performance improvements.