WordPress plugin intelligence profile

WUXT Headless WordPress API Extensions

Extensions for the Rest API to provide endpoints that support a more convenient use of headless WordPress as back-end CMS.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.2
Current version1.0
WordPress coverageTested up to WordPress 5.2
Minimum stackWP 4.7.0 · PHP —
Directory statusactive
Last directory update20 May 20197y ago
Active installations40Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records WUXT Headless WordPress API Extensions version 1.0 as active, updated 7y ago and tested up to WordPress 5.2.

Overview

About this plugin

This plugin adds a couple of extensions to the WordPress Rest API, which are aimed to make the use of WordPress as headless CMS easier.

It is originally coded for WUXT, a dockerized development environment for headless WordPress combined with NuxtJs. However, it can be used by every other application, which needs a powerful headless WordPress back-end.

WordPress API Extensions

  • Frontpage endpoint: There is no obvious way to get the WordPress front-page via the Rest API. To read the settings, you have to be authorized, which makes things unnecessary complicated. The new endpoint returns the front-page object if it is set, the ten newest posts otherwise.
  • Menu endpoint: Right now, there is no way I know of, for getting menus from the API. This endpoint returns an entire menu as nested array. Default location is “main”, but you can request other locations.
  • Slug endpoint: If you are building a front-end app on top of WordPress, you have to think about how to structure your urls. WordPress has two default post-types (posts & pages) and in the urls is not distinguished which type you are requesting, so http://wp-site.expl/something might lead to a page or a post, dependent on the type of the object with the slug something. If you want to mirror that behaviour in your app, you have to do two requests for each url, one searching pages, one searching posts. To make that one request, use the slug end-point.
  • Taxonomy filter AND extension: When filtering taxonomies with an Rest API request, all queries are OR-queries. That means you can get posts which are either in category A or B. Our adjustment lets you switch all tax_queries to an AND-relation, so that you can select posts which are both in category A and B.
  • Geo query: If your application has to get posts by geographical proximity, you can use a geo query.
  • WordPress SEO meta fields: They are included automatically in the meta object if the Yoast WordPress SEO plugin is activated.
  • Advanced custom fields are included automatically in the meta object if the plugin is activated.

Endpoints and parameters

Frontpage

  • GET /wp-json/wuxt/v1/front-page
  • GET /wp-json/wuxt/v1/front-page?_embed

Menu

  • GET /wp-json/wuxt/v1/menu
  • GET /wp-json/wuxt/v1/menu?location=<location>

Slug

  • GET /wp-json/wuxt/v1/slug/<post-or-page-slug>
  • GET /wp-json/wuxt/v1/slug/<post-or-page-slug>?_embed

Taxonomy filter AND extension

  • GET /wp-json/wp/v2/posts/?categories=1,2&and=true

GEO query

  • GET /wp-json/wp/v2/posts/?coordinates=<lat>,<lng>&distance=<distance><km|m>
  • GET /wp-json/wp/v2/posts/?coordinates=<lat_meta_field>:<lat>,<lng_meta_field>:<lng>&distance=<distance><km|m>
  • GET /wp-json/wp/v2/posts/?coordinates=52.585,13.373&distance=10
  • GET /wp-json/wp/v2/posts/?coordinates=lat_mkey:52.585,lng_mkey:13.373&distance=10
  • GET /wp-json/wp/v2/posts/?coordinates=52.585,13.373&distance=10m

Links

  • More detailed end-point description
  • WUXT
  • WUXT release blog post
  • NuxtJs

Credits

  • Michael Cox Menu Class for returning a menu as array
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • endpoint extension
  • rest api
  • headless
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.2

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.2.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.2
Minimum requirementsWordPress 4.7.0 · PHP not listed
Update activity20 May 20197y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.