Is there any chance, that this plugin will be updated to work with php 8?
Thanks for a reply!
]]>Hello.
I have CPT gallery with ACF checkboxes. I need to filter this posts by fields
My fields are
"acf": {
"field1": [
"value1"
],
"field2": [
"value2"
],
"field3": [
"value3"
],
}
I make request https://mysite.com/wp-json/wp/v2/gallery?filter[meta_key]=field1&filter[meta_value]=value1
but its show me empty array []
What I’am doing wrong?
]]>For example, will this work with something like this:
https://site.com/wp-json/buddypress/v1/members
Plz let us know. Thanx.
]]>Is it possible to construct a string to order by 2 different keys?
For example, I have a custom post type that I can order by title and by priority (ranked 0-5). I would like to first sort the results by rank in dsc order, then for them to be sorted by title.
5 – A post
5 – A second post
4 – A post
4 – A second post
4 – A third post
3 – A post
2 – A post
2 – A second post
Hi
API URL – wp-json/wp/v2/posts
acf: {
"hide": true
I can’t ever get this to work. I’ve tried
posts?filter[meta_key]=hide&filter[meta_key]=false/true
posts?filter[meta_key]=hide&filter[meta_key]=0/1
No matter what, it doesn’t work.
]]>The url is https://starclinch.com/wp-json/wp/v2/product?per_page=100&filter[meta_key]=maxprice&filter[meta_compare]=<&filter[meta_value]=500&product_cat=112
there are objects with maxprice
value greater than 500. Please reply as soon as possible.
Can there be anything to do with the caching of the values as there was an updation of ACF values recently
Thanks a lot for the plugin.
Hi, thanks for providing this plugin. When I query something with “&” in the value, I can’t get any result. Let say I want to filter company name like this:
The result comes back empty. Is there anyway to query filter with special character like “&” ? Thanks
]]>Hi guys,
please delete these four lines:
Those lines include the not required public css and js files (the files do not have any content) and thus reduce the performance of each page using this plugin due to two more useless requests in admin + frontend.
Thanks and best regards,
Jan
]]>Are there documentation for all filters?
]]>filter[date_modified_gmt]=2019-05-02T12:20:55
doesn’t have any effect. Am I doing something wrong?
I am developing an events application using the REST API and have a filter option to filter by month. The events post type has an ACF field that is used to set the date for the event.
Is it possible with this plugin to have a date range / multiple filters at once? So it would still compare against the same meta_key, but would have two different met_values and meta_compares to compare against the set meta_key?
]]>Hello,
I’d like to remove the following javascript:
/wp-content/plugins/wp-rest-filter/public/js/wp-rest-filter-public.js?ver=1.4.3
What’s the best way to do so without commenting this out in the plugin directly?
Harv
]]>Hi,
I’m having some troubles with wp-json api responses. WP don’t let me add new images, showing a message that the json response is invalid.
The image uploads correctly to the server, but the page don’t take the uploaded file.
I debugged the response, and I see a lot of whitespaces (red dots in Google network inspector) before the JSON. Any idea of what’s going on?
I’m using WP 5.1.1
Thanks!
]]>Hi, i’m use this plugin to filter json res api response like
https://www.example.it/test/alert_app/wp-json/wp/v2/posts
I’m able to filter for example title and content of posts with
?fields=title.rendered,content.rendered parameters
But if i try to filter a third level deep fields it doesn’t works: How to get id?
[
{
“_embedded”: {
“author”: [
{
“id”: 1,
“name”: “admin”
}
]
}
}
],
“wp:featuredmedia”: [],
“wp:term”: []
}
}
]
When making an internal API request, the filter does not work:
$request = new WP_REST_Request( 'GET', '/wp/v2/media' );
$request->set_query_params( [ 'filter[media_category]' => 'test' ] );
return rest_do_request( $request );
With an external request the filter works as intended:
.../wp-json/wp/v2/media/?filter[media_category]=test
How can I fix this?
Thank you!
Hi, I am using your plugin since today to retrieve all products that have the value “fokusklasse” in the acf field “eventart”. Works perfectly, I get my four products that correspond to the request in the JSON.
My second step should now be to sort the four products according to their acf field “sortierungsdatum” in ascending order. The value of this field is a date Y-m-d but formatted as Ymd. So it’s basically a number, right? I just cannot get the right order.
Can you have a look at my URL and probably help me with the parameters for ordering? When I change asc to desc, the order changes but it is never in the right order.
Thank you in advance! Micha
]]>Hi,
I’ve a number field in advanced custom field. When I query via filter
&filter[meta_key]=posizione&filter[orderby]=meta_value_num&filter[order]=asc
all it’s ok but when I try to order results:
&filter[status]=publish&filter[meta_key]=posizione&filter[orderby]=meta_value_num&filter[order]=asc&filter[meta_compare]=<&filter[meta_value]=20
all goes wrong.
Any suggestion?
Thanks in advance
]]>WooCommerce had filter support in legacy API but removed in new API because they share the same API as WP. Please add support for WooCommerce Products and Orders. Thanks.
]]>Hello everyone,
I would like to filter the list on given URL on attribute “post_status” with value “future”. The first in the list will be the next match for my club. I try to used this plugin to retrieve only games in the future but it failed.
Can you please support.
]]>I noticed the other day that posts marked as Private, with certain meta data that should be returned from queries using this filter extension, do not – even though the authenticated user making the REST call is an admin user (and in fact these posts with requests without filters are returned).
Is this an issue with this filter, do I need an extra argument for these types of posts… or is this a WordPress (I’m on 5.x) feature preventing results?
Thanks
]]>Our WP backend uses the REST API to search for articles to select for various sections. Currently the keywords that are used for search are compared against the body of the article, etc. Instead, we want it just to search on the article title.
So I’ve made a custom argument that allows us to do that from PHP:
add_filter( ‘posts_where’, function ( $where, \WP_Query $q )
{
global $wpdb;
$query_by_title = $q->get( ‘queryByTitle’ );
if ( $query_by_title = $q->get( ‘queryByTitle’ ) ) {
$where .= ‘ AND ‘ . $wpdb->posts . ‘.post_title LIKE \” . esc_sql( $wpdb->esc_like( $query_by_title ) ) . ‘%\”;
}
return $where;
}, 10, 2 );
This works beautifully when called from PHP like this:
$query = new WP_Query( array( ‘queryByTitle’ => ‘some phrase’ ) );
How can I use the new queryByTitle argument via the REST API? I’ve tried this, but no luck:
/wp-json/wp/v2/posts/?filter[queryByTitle]=some phrase
Any ideas how a custom argument can be used with the WP REST Filter plugin?
]]>Is it possible to filter nested acf keys? I can’t seem to find any docs on if this is possible.
Example:
I have a structure like below and want to filter by a nested ACF key named “lat” under “acf”=>”northeast”=>”lat”. Possible? Example?
[
{
"acf": {
"northeast": {
"address": "Garven",
"lat": "23.000",
"lng": "-96.2345",
"zoom": "",
"center_lat": "",
"center_lng": ""
},
"southwest": {
"address": "Unnamed Road",
"lat": "34.003033",
"lng": "-121.0222",
"zoom": "",
"center_lat": "",
"center_lng": ""
}
},
}
]
]]>
I have done everything possible to get this plugin to filter my custom answers by parent post (question ID), but it has totally failed. Here https://idiscuss365.com/wp-json/wp/v2/answer?filter%5Bmeta_key%5D=question&filter%5Bmeta_value%5D=4441
I went ahead and created a custom endpoint that displays all content including parent IDs, which in this case are called “question”, and still, when you enter: https://idiscuss365.com/wp-json/app/v1/answers?filter%5Bmeta_key%5D=question&filter%5Bmeta_value%5D=4396
All answers, without filtering out those with question ID 4396 show up. Please check this link.
I really appreciate your help on this. Thanks!
]]>Hi, I am trying to use this plugin to do multi-filter meta key without full value?
Like instead of : https://domain.com/wp-json/wp/v2/something?filter%5Bmeta_key%5D=somekey&filter%5Bmeta_value%5D=somevalue
I want to query like this : https://domain.com/wp-json/wp/v2/something?filter%5Bmeta_key%5D=somekey&filter%5Bmeta_value%5D=some
I only input partial value for the meta_value, so the output I can get include list of items with meta_value like sometime, someshoes, or someclothes.
I ask so because I found that you need to use exact full value for the meta_value else will return blank response.
If this is not possible with this plugin. Could you direct me to the right direction? Either by adding custom code in function.php or any useful doc, I am new to php.
Thanks for your time.
]]>Hey, just a general question. This looks very useful. I was wondering, why was it taken out of 4.7 in the first place? What was the general reasoning?
]]>Hi, just started working with your app, great work! Very useful.
Could you please provide some instruction on how to complete multiple meta queries in one http request? I tried your example and cannot get it to work. What is the format for each query?
Thanks,
Tom
Hi there,
I was very happy to find you plugin!
But then I realized, I can’t use it properly…
I want to query a custom post type with a date-filter:
The ACF Field in my CPT is called “datum” and the format is Y-m-d. The given request leads to a result of all entries, although none of it has a “datum” field greater than the specified date…
Also, if I pick a date in the middle of my CPT entries, I either get all (using >) or none (using <). Same for >= and <=..
I managed to get other queries working though! Other CPT ACF fields with strings as values work without a problem in the filter…
Any ideas how to approach this?
All the best,
Can
test topic on forum content
]]>I had to use a backup of my version 1.1.6 ??
]]>Hello, thaks for providing this plugin.
Unfortunately, after last weekend my WP-REST doesn’t work. It response no data when this Rest-Filter plugin is activated. I think this plugin could cause this error.
?My environment
WordPress 4.9.6
PHP/7.0.23
If you have time, please check it.
Thanks,
Yu