• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Theme_Upgrader::current_after() – Turn off maintenance mode after upgrading the current theme.

You appear to be a bot. Output may be restricted

Description

Turn off maintenance mode after upgrading the current theme.

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

Usage

$bool|WP_Error = Theme_Upgrader::current_after( $return, $theme );

Parameters

$return
( bool|WP_Error ) required – Upgrade offer return.
$theme
( array ) required – Theme arguments.

Returns

bool|WP_Error The passed in $return param or WP_Error.

Source

File name: wordpress/wp-admin/includes/class-theme-upgrader.php
Lines:

1 to 25 of 25
  public function current_after( $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;
    }

    // Ensure stylesheet name hasn't changed after the upgrade:
    if ( get_stylesheet() === $theme && $theme !== $this->result['destination_name'] ) {
      wp_clean_themes_cache();
      $stylesheet = $this->result['destination_name'];
      switch_theme( $stylesheet );
    }

    // Time to remove maintenance mode. Bulk edit handles this separately.
    if ( ! $this->bulk ) {
      $this->maintenance_mode( false );
    }
    return $return;
  }
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: Theme_Upgrader::current_after
Class ref: Theme_Upgrader
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-admin/includes/class-theme-upgrader.php
File ref: wp-admin/includes/class-theme-upgrader.php
Deprecated?: No
API Letters: A,C,T,U

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites