Feature media image WordPress Rest API expose

Software

Nederlands:

Om het gebruiken van afbeeldingen in een WordPress app mogelijk te maken zonder allerlei code te moeten toevoegen in functions.php heb ik de plugin “Feature media image WordPress Rest API expose” in de WordPress plugin directory gezet. Deze plugin voegt simpelweg een extra Json Rest eindpunt toe die de URL van de afbeelding mee geeft in een /posts verzoek. Met deze directe URL kan een app of headless WordPress systeem makkelijk de afbeelding vinden en weergeven.

De plugin geeft het volgende rest object weer: “featured_img_url”

Als er geen featured image wordt gevonden geeft de plugin: “0”

Output url: www.yourwebsite.domain/wp-json/wp/v2/posts

English:

To make the use of images in a WordPress app possible without adding extra code to function.php i’ve added the “” plugin to the WordPress plugins. This plugin adds an extra Rest API endpoint with the URL of the image on a /posts request. With this direct URL, an APP or headless WordPress system can easily display the image.

The plugin gives the flowing Rest object: “featured_img_url”

If no featured images is found, the plugin displays: “0”

Output url: www.yourwebsite.domain/wp-json/wp/v2/posts

0 reacties

Latest Posts

Meer artikelen