WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Theme_Upgrader::current_before() public WP 2.8.0

Turn on maintenance mode before attempting to upgrade the current theme.

Hooked to the 'upgrader_pre_install' filter by Theme_Upgrader::upgrade() and Theme_Upgrader::bulk_upgrade().

Это метод класса: Theme_Upgrader{}

Хуков нет.

Возвращает

true/false/WP_Error. The passed in $return param or WP_Error.

Использование

$Theme_Upgrader = new Theme_Upgrader();
$Theme_Upgrader->current_before( $return, $theme );
$return(true/false/WP_Error) (обязательный)
Upgrade offer return.
$theme(массив) (обязательный)
Theme arguments.

Список изменений

С версии 2.8.0 Введена.

Код Theme_Upgrader::current_before() WP 5.5.1

wp-admin/includes/class-theme-upgrader.php
<?php
public function current_before( $return, $theme ) {
	if ( is_wp_error( $return ) ) {
		return $return;
	}

	$theme = isset( $theme['theme'] ) ? $theme['theme'] : '';

	// Only run if current theme
	if ( get_stylesheet() !== $theme ) {
		return $return;
	}

	// Change to maintenance mode. Bulk edit handles this separately.
	if ( ! $this->bulk ) {
		$this->maintenance_mode( true );
	}

	return $return;
}