WP_REST_Server::add_site_icon_to_index() WordPress Method
The WP_REST_Server::add_site_icon_to_index() method allows you to add a site icon to the index. This is useful if you want to add a site icon to the index without having to use a plugin or if your theme doesn't support site icons.
WP_REST_Server::add_site_icon_to_index( WP_REST_Response $response ) #
Exposes the site icon through the WordPress REST API.
Description
This is used for fetching this information when user has no rights to update settings.
Parameters
- $response
(WP_REST_Response)(Required)REST API response.
Source
File: wp-includes/rest-api/class-wp-rest-server.php
protected function add_site_icon_to_index( WP_REST_Response $response ) { $site_icon_id = get_option( 'site_icon', 0 ); $this->add_image_to_index( $response, $site_icon_id, 'site_icon' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |