WP_REST_Server::add_site_logo_to_index() WordPress Method

The add_site_logo_to_index() method allows you to add a custom site logo to the index page of your WordPress site. This is useful if you want to branding your site with a specific logo or image.

WP_REST_Server::add_site_logo_to_index( WP_REST_Response $response ) #

Exposes the site logo through the WordPress REST API.


Description

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


Top ↑

Parameters

$response

(WP_REST_Response)(Required)REST API response.


Top ↑

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', 0 );

		$this->add_image_to_index( $response, $site_logo_id, 'site_logo' );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.