WordPress at a glance
function is not described

WP_REST_Themes_Controller::is_same_theme() protected WP 5.7.0

Helper function to compare two themes.

{} It's a method of the class: WP_REST_Themes_Controller{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_same_theme( $theme_a, $theme_b );
$theme_a(WP_Theme) (required)
First theme to compare.
$theme_b(WP_Theme) (required)
Second theme to compare.

Changelog

Since 5.7.0 Introduced.

Code of WP_REST_Themes_Controller::is_same_theme() WP 5.7.2

<?php
protected function is_same_theme( $theme_a, $theme_b ) {
	return $theme_a->get_stylesheet() === $theme_b->get_stylesheet();
}