Exposes the site logo through the WordPress REST API.
This is used for fetching this information when user has no rights to update settings.
$responseWP_REST_Responserequired
protected function add_site_logo_to_index( WP_REST_Response $response ) {
$site_logo_id = get_theme_mod( 'custom_logo', 0 );
$this->add_image_to_index( $response, $site_logo_id, 'site_logo' );
}
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_logo_to_index