Using REST API and WordPress Block Editor (aka Gutenberg)

WPCasa is a very developer friendly plugin. With version 1.4.0 the enpoints for listings and all associated taxonomies were added to the WordPress REST API. This means that, if required, listings and taxonomies can also be queried via the REST API.
This function also activates the compatibility with the WordPress block editor.

Activate Endpoints

The endpoints should only be activated if this is necessary. Therefore this function is deactivated by default. To activate them, go to WPCasa > Settings > Listings in the WordPress backend. Navigate to the REST API section and activate the switch.

WPCasa Settings REST API

With REST-API activated, WordPress switches to the block editor (aka Gutenberg) for editing the WPCasa pages. You can use all available blocks to create the listing text and the text on the front page. However, you cannot change the layout with the block editor.

REST API Developer Endpoint Reference

To use the new endpoints you can call https://example.com/wp-json/wp/v2/{endpoint}. The following endpoints are available:

  • wpsight-listing
  • wpsight-location
  • wpsight-listing-type
  • wpsight-feature
  • wpsight-listing-category

The name of the endpoints corresponds to the slug of the contribution type and the taxonomies with the prefix wpsight-. If you have changed these with the associated filters, please use this name instead of the one listed, also with the prefix wpsight-.

Was this article helpful? Yes · No