REST API Featured Image
REST API Featured Image is a lightweight yet powerful plugin that simplifies how to retrieve featured images via the WordPress REST API. By introducing a top-level field called featured_media_src_url , this plugin embeds the direct URL of the featured image into your REST API responses. This elimina
REST API Featured Image is a lightweight yet powerful plugin that simplifies how to retrieve featured images via the WordPress REST API. By introducing a top-level field called featured_media_src_url , this plugin embeds the direct URL of the featured image into your REST API responses. This eliminates the need for additional API calls to fetch featured images, resulting in faster load times and enhanced site performance.
Key Features:
– Direct Access to Featured Image URL: Adds featured_media_src_url to REST API responses, providing immediate access to the featured image URL. – Performance Optimization: Reduces the number of API requests, improving the speed and efficiency of your applications. – Custom Post Type Support: Fully supports custom post types, allowing you to enable or disable the featured image URL field for specific post types through the admin settings. – User-Friendly Configuration: Easy to install and configure without any coding.
Why Use REST API Featured Image?
When developing applications or themes that rely on the WordPress REST API, accessing the featured image typically requires an additional request for each post. This can be time-consuming and may negatively impact site performance. REST API Featured Image addresses this issue by including the featured image URL directly in the REST API response, saving you time and resources.
REST API Featured Image Field:
– featured_media_src_url
- 01Upload the Plugin Files: – Upload the rest-api-featured-image folder to the /wp-content/plugins/ directory. – Or install the plugin directly through the WordPress plugins screen.
- 02Activate the Plugin: – Activate the plugin through the ‘Plugins’ screen in WordPress.
- 03Configure Plugin Settings: – Navigate to the plugin settings page in the WordPress admin area. – Select the post types for which you want to enable or disable the featured image URL field.