WordPress Developer Ukraine, Kyiv
Extend the WordPress REST API with register_rest_field()

Extend the WordPress REST API with register_rest_field()

Extend the WordPress REST API with register_rest_field() The REST API returns a fixed set of fields for every post: id, title, content, status and so on. Data that a theme or plugin keeps in post meta, in terms or in its own tables is not there. With register_rest_field() you add it to the existing response,…
How to Get User Location by IP Address in WordPress

How to Get User Location by IP Address in WordPress

How to get a user’s location by IP address in WordPress Geolocation lets you show or hide content depending on the visitor’s country: region-restricted products, localised promotions, country-specific notices. The approach has three steps: get the visitor’s IP, ask a geolocation service which country it belongs to, and act on the result.
Using the WordPress REST API as a Headless CMS Backend

Using the WordPress REST API as a Headless CMS Backend

Use the WordPress REST API as a headless CMS backend In a headless setup WordPress is only the place where content is written and stored. The site that visitors see is a separate application, for example in React or Vue, that reads the content through the REST API. Editors keep the familiar admin, and the…