Changeset 47409
- Timestamp:
- 03/03/2020 12:27:52 AM (5 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r47275 r47409 445 445 446 446 /** 447 * Turn on maintenance mode before attempting to background update an active plugin.447 * Turns on maintenance mode before attempting to background update an active plugin. 448 448 * 449 449 * Hooked to the {@see 'upgrader_pre_install'} filter by Plugin_Upgrader::upgrade(). … … 451 451 * @since 5.4.0 452 452 * 453 * @param bool|WP_Error $return454 * @param array $plugin455 * @return bool|WP_Error 453 * @param bool|WP_Error $return Upgrade offer return. 454 * @param array $plugin Plugin package arguments. 455 * @return bool|WP_Error The passed in $return param or WP_Error. 456 456 */ 457 457 public function active_before( $return, $plugin ) { … … 467 467 $plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : ''; 468 468 469 if ( ! is_plugin_active( $plugin ) ) { // If not active. 470 return $return; 471 } 472 473 // Bulk edit handles maintenance mode separately. 469 // Only run if plugin is active 470 if ( ! is_plugin_active( $plugin ) ) { 471 return $return; 472 } 473 474 // Change to maintenance mode. Bulk edit handles this separately. 474 475 if ( ! $this->bulk ) { 475 476 $this->maintenance_mode( true ); … … 480 481 481 482 /** 482 * Turn off maintenance mode after upgrading an active plugin.483 * Turns off maintenance mode after upgrading an active plugin. 483 484 * 484 485 * Hooked to the {@see 'upgrader_post_install'} filter by Plugin_Upgrader::upgrade(). … … 486 487 * @since 5.4.0 487 488 * 488 * @param bool|WP_Error $return 489 * @param array $plugin 490 * @return bool|WP_Error 489 * @param bool|WP_Error $return Upgrade offer return. 490 * @param array $plugin Plugin package arguments. 491 * @return bool|WP_Error The passed in $return param or WP_Error. 491 492 */ 492 493 public function active_after( $return, $plugin ) { … … 502 503 $plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : ''; 503 504 504 if ( ! is_plugin_active( $plugin ) ) { // If not active. 505 return $return; 506 } 507 508 // Bulk edit handles maintenance mode separately. 505 // Only run if plugin is active 506 if ( ! is_plugin_active( $plugin ) ) { 507 return $return; 508 } 509 510 // Time to remove maintenance mode. Bulk edit handles this separately. 509 511 if ( ! $this->bulk ) { 510 512 $this->maintenance_mode( false ); … … 515 517 516 518 /** 517 * Delete the old plugin during an upgrade.519 * Deletes the old plugin during an upgrade. 518 520 * 519 521 * Hooked to the {@see 'upgrader_clear_destination'} filter by … … 524 526 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 525 527 * 526 * @param bool|WP_Error $removed 527 * @param string $local_destination 528 * @param string $remote_destination 529 * @param array $plugin 528 * @param bool|WP_Error $removed Whether the destination was cleared. true on success, WP_Error on failure. 529 * @param string $local_destination The local package destination. 530 * @param string $remote_destination The remote package destination. 531 * @param array $plugin Extra arguments passed to hooked filters. 530 532 * @return bool|WP_Error 531 533 */ -
trunk/src/wp-admin/includes/class-theme-upgrader.php
r47219 r47409 529 529 * @since 2.8.0 530 530 * 531 * @param bool|WP_Error $return532 * @param array $theme533 * @return bool|WP_Error 531 * @param bool|WP_Error $return Upgrade offer return. 532 * @param array $theme Theme arguments. 533 * @return bool|WP_Error The passed in $return param or WP_Error. 534 534 */ 535 535 public function current_before( $return, $theme ) { … … 540 540 $theme = isset( $theme['theme'] ) ? $theme['theme'] : ''; 541 541 542 if ( get_stylesheet() !== $theme ) { // If not current. 542 // Only run if current theme 543 if ( get_stylesheet() !== $theme ) { 543 544 return $return; 544 545 } 545 546 546 // Change to maintenance mode now.547 // Change to maintenance mode. Bulk edit handles this separately. 547 548 if ( ! $this->bulk ) { 548 549 $this->maintenance_mode( true ); … … 560 561 * @since 2.8.0 561 562 * 562 * @param bool|WP_Error $return563 * @param array $theme564 * @return bool|WP_Error 563 * @param bool|WP_Error $return Upgrade offer return. 564 * @param array $theme Theme arguments. 565 * @return bool|WP_Error The passed in $return param or WP_Error. 565 566 */ 566 567 public function current_after( $return, $theme ) { … … 571 572 $theme = isset( $theme['theme'] ) ? $theme['theme'] : ''; 572 573 573 if ( get_stylesheet() !== $theme ) { // If not current. 574 // Only run if current theme 575 if ( get_stylesheet() !== $theme ) { 574 576 return $return; 575 577 } … … 582 584 } 583 585 584 // Time to remove maintenance mode. 586 // Time to remove maintenance mode. Bulk edit handles this separately. 585 587 if ( ! $this->bulk ) { 586 588 $this->maintenance_mode( false );
Note: See TracChangeset
for help on using the changeset viewer.