WP_REST_Server::add_site_logo_to_index( WP_REST_Response $response )

Exposes the site logo through the WordPress REST API.


Description Description

This is used for fetching this information when user has no rights to update settings.


Top ↑

Parameters Parameters

$response

(WP_REST_Response) (Required) REST API response.


Top ↑

Source Source

File: wp-includes/rest-api/class-wp-rest-server.php

	protected function add_site_logo_to_index( WP_REST_Response $response ) {
		$site_logo_id                = get_theme_mod( 'custom_logo' );
		$response->data['site_logo'] = $site_logo_id;
		if ( $site_logo_id ) {
			$response->add_link(
				'https://api.w.org/featuredmedia',
				rest_url( 'wp/v2/media/' . $site_logo_id ),
				array(
					'embeddable' => true,
				)
			);
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.