Title: date_query enabler
Author: arikogan
Published: <strong>Mawrth 1, 2016</strong>
Last modified: Chwefror 28, 2016

---

Search plugins

Nid yw’r ategyn hwn **wedi cael ei ddiweddaru ers 3 ryddhad mawr**. Efallai nad 
yw’n cael ei gynnal bellach ac efallai bod materion cydnawsedd wrth gael ei ddefnyddio
gyda fersiynau mwy diweddar o WordPress.

![](https://s.w.org/plugins/geopattern-icon/date-query-enabler.svg)

# date_query enabler

 Gan [arikogan](https://profiles.wordpress.org/arikogan/)

[Llwytho i lawr](https://downloads.wordpress.org/plugin/date-query-enabler.zip)

 * [Details](https://cy.wordpress.org/plugins/date-query-enabler/#description)
 * [Reviews](https://cy.wordpress.org/plugins/date-query-enabler/#reviews)
 *  [Installation](https://cy.wordpress.org/plugins/date-query-enabler/#installation)
 * [Development](https://cy.wordpress.org/plugins/date-query-enabler/#developers)

 [Cefnogaeth](https://wordpress.org/support/plugin/date-query-enabler/)

## Disgrifiad

[WP REST API](http://v2.wp-api.org/) plugin provides the ability to interact with
a WordPress installation through a REST API. When retrieving posts, a use case would
be to filter them based on they publish date by before/after a certain date. In 
WordPress this can be achieved using the [date_query](https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters)
parameter. However, the parameter is not part of the whitelisted parameters of WP
REST API. A workaround is to add it ourselves as discussed [here](https://github.com/WP-API/WP-API/issues/389).
This plugin adds the date_query param to the whitelist not modifying the theme of
WordPress but by using a very small and simple plugin. This allows to change and
upgrade themes freely and still keep the whitelisting of the parameter.

After installing WP REST API and this plugin, you should be able to run queries 
like the below,

    ```
    /wp-json/wp/v2/posts?filter[date_query][after]=2016-02-26T12:38:36
    /wp-json/wp/v2/posts?filter[date_query][before]=2016-02-27T14:28:15
    ```

## Gosod

 1. Upload the plugin files to the `/wp-content/plugins/date_query` directory, or install
    the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress

## Adolygiadau

![](https://secure.gravatar.com/avatar/0dbd5f9c2161eb9f3b830ee8db4cbf3398ecaaface509004fe2f7a98e0e109c6?
s=60&d=retro&r=g)

### 󠀁[Clean](https://wordpress.org/support/topic/clean-22/)󠁿

 [VenomVendor](https://profiles.wordpress.org/venomvendor/) Medi 3, 2016

Just as needed.

![](https://secure.gravatar.com/avatar/a47a032bb1464f31882baa5bc2d4948efe26f2079a21e34a6119ec517d66ea98?
s=60&d=retro&r=g)

### 󠀁[As is](https://wordpress.org/support/topic/as-is/)󠁿

 [emreerdogan](https://profiles.wordpress.org/emreerdogan/) Medi 3, 2016

This is what I was expecting. Thanks.

 [ Read all 2 reviews ](https://wordpress.org/support/plugin/date-query-enabler/reviews/)

## Contributors & Developers

“date_query enabler” is open source software. The following people have contributed
to this plugin.

Cyfranwyr

 *   [ arikogan ](https://profiles.wordpress.org/arikogan/)

[Translate “date_query enabler” into your language.](https://translate.wordpress.org/projects/wp-plugins/date-query-enabler)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/date-query-enabler/),
check out the [SVN repository](https://plugins.svn.wordpress.org/date-query-enabler/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/date-query-enabler/)
by [RSS](https://plugins.trac.wordpress.org/log/date-query-enabler/?limit=100&mode=stop_on_copy&format=rss).

## Cofnod Newid

#### 0.1

 * First version.

## Meta

 *  Version **0.1**
 *  Last updated **10 blynedd yn ôl**
 *  Active installations **10+**
 *  Tested up to **4.3.34**
 *  Language
 * [English (US)](https://wordpress.org/plugins/date-query-enabler/)
 * Tags
 * [api](https://cy.wordpress.org/plugins/tags/api/)[rest](https://cy.wordpress.org/plugins/tags/rest/)
 *  [Advanced View](https://cy.wordpress.org/plugins/date-query-enabler/advanced/)

## Graddau

 5 out of 5 stars.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/date-query-enabler/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/date-query-enabler/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/date-query-enabler/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/date-query-enabler/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/date-query-enabler/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/date-query-enabler/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/date-query-enabler/reviews/)

## Cyfranwyr

 *   [ arikogan ](https://profiles.wordpress.org/arikogan/)

## Cefnogaeth

Rhywbeth i’w ddweud? Angen help?

 [Gweld y fforwm cefnogi](https://wordpress.org/support/plugin/date-query-enabler/)