Este plugin no se ha probado con las últimas 3 versiones mayores de WordPress. Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas de compatibilidad cuando se usa con las versiones más recientes de WordPress.

date_query enabler

Descripción

WP REST API 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 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. 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

Instalación

  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

Reseñas

3 de septiembre de 2016
This is what I was expecting. Thanks.
Leer todas las 2 reseñas

Colaboradores y desarrolladores

«date_query enabler» es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

Traduce «date_query enabler» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

0.1

  • First version.