Theme_Upgrader::current_before()
最后更新于:2021-11-26 04:13:20
Theme_Upgrader::current_before( bool|GC_Error$return, array$theme)Turn on maintenance mode before attempting to upgrade the current theme.
参数
- $return
-
(bool|GC_Error) (Required) Upgrade offer return.
- $theme
-
(array) (Required) Theme arguments.
响应
(bool|GC_Error) The passed in $return param or GC_Error.
源文件
文件: gc-admin/includes/class-theme-upgrader.php
public function current_before( $return, $theme ) {
if ( is_gc_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;
}