{"id":79733,"date":"2018-01-03T13:09:18","date_gmt":"2018-01-03T13:09:18","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-rest-filter\/"},"modified":"2019-03-02T00:07:07","modified_gmt":"2019-03-02T00:07:07","slug":"wp-rest-filter","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wp-rest-filter\/","author":15411579,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.4.3","stable_tag":"trunk","tested":"5.1.22","requires":"4.7.0","requires_php":"5.2.4","requires_plugins":"","header_name":"WP REST Filter","header_author":"SK8Tech","header_description":"Since WordPress 4.7 the `filter` argument for any post endpoint was removed. This plugin restores the `filter` parameter for websites that were previously using it.","assets_banners_color":"","last_updated":"2019-03-02 00:07:07","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/sk8.tech\/donate?utm_source=plugin&utm_medium=forum&utm_campaign=wp-rest-filter","header_plugin_uri":"https:\/\/sk8.tech\/?utm_source=wp-admin&utm_medium=forum&utm_campaign=wp-rest-filter","header_author_uri":"https:\/\/sk8.tech\/?utm_source=wp-admin&utm_medium=forum&utm_campaign=wp-rest-filter","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":38474,"num_ratings":0,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["installation","faq","changelog","description"],"tags":[],"upgrade_notice":{"":"<p>Nothing to worry! Install away!<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"3"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1808268","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1808268","resolution":"256x256","location":"assets"}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.23","1.0.24","1.0.3","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.2.0","1.2.2","1.2.3","1.2.4","1.2.5","1.3.0","1.4.0","1.4.1","1.4.2","1.4.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1808268","resolution":"1","location":"assets"}},"screenshots":{"1":"An sample REST API GET request using <a href=\"https:\/\/wordpress.org\/plugins\/wp-rest-filter\/\">WP REST Filter<\/a>."}},"plugin_section":[],"plugin_tags":[1556,2236,2299,23853,292],"plugin_category":[],"plugin_contributors":[151394,152205],"plugin_business_model":[],"class_list":["post-79733","plugin","type-plugin","status-closed","hentry","plugin_tags-api","plugin_tags-filter","plugin_tags-rest","plugin_tags-rest-api","plugin_tags-wp","plugin_contributors-jack50n9","plugin_contributors-sk8tech","plugin_committers-jack50n9","plugin_committers-sk8tech"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-rest-filter.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-rest-filter\/assets\/screenshot-1.png?rev=1808268","caption":"An sample REST API GET request using <a href=\"https:\/\/wordpress.org\/plugins\/wp-rest-filter\/\">WP REST Filter<\/a>."}],"raw_content":"<!--section=installation-->\n<ol>\n<li>Upload <code>wp-rest-filter<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Why do I need WP REST Filter?<\/dt>\n<dd><p>If you're planning on using your WordPress website as a Backend, and you're consuming RESTful api, you'll most probably need to filter results on your GET request. This is precisely what this plugin does.<\/p><\/dd>\n<dt>Can I filter for multiple meta queries?<\/dt>\n<dd><p>YES! See Description.<\/p><\/dd>\n<dt>Can I Use this plugin to find posts by tags\/categories?<\/dt>\n<dd><p>Yes, however this is natively supported by WordPress 4.7+. This plugin is not necessary if you??re looking to find posts by tags\/categories.<\/p>\n\n<p>For more info, please <a href=\"https:\/\/wordpress.org\/support\/topic\/empty-response-2\/\">see this topic<\/a>.<\/p><\/dd>\n<dt>Does this work with Custom Post Type?<\/dt>\n<dd><p>Yes! This plugin is designed to work with CPT types too!<\/p><\/dd>\n<dt>Does this work with Taxonomy?<\/dt>\n<dd><p>Yes! This plugin filters Taxonomy as well. Thanks to <a href=\"https:\/\/github.com\/SK8-PTY-LTD\/wp-rest-filter\/pull\/2\">pull request by bplaa-yai<\/a>.<\/p><\/dd>\n<dt>Does this work with Advanced Custom Field?<\/dt>\n<dd><p>Yes! This plugin is designed to work with ACF values too!<\/p><\/dd>\n<dt>I've received a 403 page upon activation<\/dt>\n<dd><p>This is likely due to <a href=\"https:\/\/css-javascript-toolbox.com\/ticket\/bulletproof-security-ajax-issue-and-resolution\/\">AJAX is disabled on your wp-admin\/plugins.php<\/a> page. If you are using BulletProof Security Plugin, here's how to fix it.<\/p>\n\n<p>Go to htaccess Core -&gt; Custom Code -&gt; wp-admin htaccess File Custom Code , paste the following code to '3. CUSTOM CODE WPADMIN PLUGIN\/FILE SKIP RULES' section.<\/p>\n\n<p>`<\/p><\/dd>\n<dt>post.php skip\/bypass rule<\/dt>\n<dd><p>RewriteCond %{REQUEST_URI} (post&#046;php) [NC]\nRewriteRule . - [S=2]<\/p><\/dd>\n<dt>plugins.php skip\/bypass rule<\/dt>\n<dd><p>RewriteCond %{REQUEST_URI} (plugins&#046;php) [NC]\nRewriteRule . - [S=2]\n`<\/p>\n\n<p>Click 'Save wp-admin Custom Code', then go to htaccess Core -&gt; Security Modes, click 'Activate' under 'wp-admin Folder BulletProof Mode (WBM)'<\/p>\n\n<p>Now you should be able to activate plugin without any issue.<\/p><\/dd>\n<dt>There's a bug, what do I do?<\/dt>\n<dd><p>Please email us at wp-rest-filter@sk8.tech.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4.3<\/h4>\n\n<ul>\n<li>Security Fix.<\/li>\n<li>Safe to Update.<\/li>\n<\/ul>\n\n<h4>1.4.2<\/h4>\n\n<ul>\n<li>Added Features: Search &amp; Filter Array value.<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Added Filter support for 'User' type.<\/li>\n<\/ul>\n\n<h4>1.2.4<\/h4>\n\n<ul>\n<li>Fixed another critical issue relating to custom post type<\/li>\n<\/ul>\n\n<h4>1.2.2 (breaking)<\/h4>\n\n<ul>\n<li>Fixed a critical issue relating to custom post type<\/li>\n<\/ul>\n\n<h4>1.2.0 (Breaking)<\/h4>\n\n<ul>\n<li>Added support for filtering by Taxonomy<\/li>\n<li>Restructured Project for further development<\/li>\n<\/ul>\n\n<h4>1.1.4<\/h4>\n\n<ul>\n<li>Added support for filtering by custom filed date<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Added support for Multiple Meta Queries<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Minor README fixes.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Minor README fixes.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Minor README fixes.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial Release.<\/li>\n<\/ul>\n\n<!--section=description-->\n<p>Since WordPress 4.7 the <code>filter<\/code> argument for any post endpoint was removed.<\/p>\n\n<p>This plugin restores the <code>filter<\/code> parameter for websites that were previously using it.<\/p>\n\n<h4>Usage<\/h4>\n\n<p>Use the <code>filter<\/code> parameter on any Post, or Custom Post Type endpoint such as <code>\/wp\/v2\/posts<\/code> or <code>\/wp\/v2\/cpt<\/code> as an array of <code>WP_Query<\/code>\nargument. ACF values are also supported.<\/p>\n\n<h3>Default Post Type<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/posts?filter[meta_key]=acfkey&amp;filter[meta_value]=acfvalue');\n<\/code><\/pre>\n\n<h3>Filter Users<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/users?filter[meta_key]=acfkey&amp;filter[meta_value]=acfvalue');\n<\/code><\/pre>\n\n<h3>Custom Post Type<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_key]=currency&amp;filter[meta_value]=AUD'); \/\/ here 'cars' is the endpoint for CPT\n<\/code><\/pre>\n\n<h3>Advanced Custom Field<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_key]=price&amp;filter[meta_compare]=&lt;&amp;filter[meta_value]=200000'); \/\/ Query for car 'less' than '200000' in 'price'\n<\/code><\/pre>\n\n<h3>Advanced Custom Field - By Date (before, equal &amp; after)<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_key]=expiry_date&amp;filter[meta_value]=2018-12-27T23:59:59&amp;filter[meta_compare]=&lt; \/\/ 'Expiry' Before '2018 Boxing Day ends'\n<\/code><\/pre>\n\n<h3>Advanced Custom Field - Value in Array (Single Value)<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_key]=features&amp;filter[meta_compare]=LIKE&amp;filter[meta_value]=electric\n<\/code><\/pre>\n\n<h3>Advanced Custom Field - Search<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_key]=brands&amp;filter[meta_compare]=LIKE&amp;filter[meta_value]=tesla\n<\/code><\/pre>\n\n<h3>Multiple Meta Queries<\/h3>\n\n<pre><code>fetch( 'https:\/\/domain.com\/wp-json\/wp\/v2\/cars?filter[meta_query][0][key]=currency&amp;filter[meta_query][0][value]&amp;filter[meta_query][1][key]=country&amp;filter[meta_query][1][value]=Australia'); \/\/ here 'cars' is the endpoint for CPT\n<\/code><\/pre>\n\n<h4>Technical Support<\/h4>\n\n<p><strong>SK8Tech - Customer Success Specialist<\/strong> offers <strong>Technical Support<\/strong> to configure or install <strong><em>WP REST Filter<\/em><\/strong>.<\/p>\n\n<h4>Our Services<\/h4>\n\n<ul>\n<li><a href=\"https:\/\/sk8.tech\/web-design\/?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">SK8Tech Sydney Web Design<\/a><\/li>\n<li><a href=\"https:\/\/sk8.tech\/services\/enterprise\/email-hosting\/?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">SK8Tech Enterprise Email Hosting<\/a><\/li>\n<li><a href=\"https:\/\/sk8.tech\/services\/enterprise\/it-support\/emergency-support\/?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">SK8Tech Emergency IT Support<\/a><\/li>\n<li><a href=\"https:\/\/sk8.tech\/services\/wechat\/?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">SK8Tech WeChat Advertising<\/a><\/li>\n<\/ul>\n\n<h3>Contact Us<\/h3>\n\n<p>Based in Sydney, <a href=\"https:\/\/sk8.tech?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">SK8Tech<\/a> is a innovative company providing IT services to SMEs, including <a href=\"https:\/\/sk8.tech\/web-design?utm_source=plugin&amp;utm_medium=forum&amp;utm_campaign=wp-rest-filter\">Web Design<\/a>, App Development and more.<\/p>","raw_excerpt":"Since WordPress 4.7 the filter argument for any post endpoint was removed.\n\nThis plugin restores the filter parameter for websites that were previousl &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/79733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=79733"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jack50n9"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=79733"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=79733"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=79733"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=79733"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=79733"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=79733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}