Action hook 'wp_upgrade'

in WP Core File wp-admin/includes/upgrade.php at line 699

View Source

wp_upgrade

Action Hook
Description
Fires after a site is fully upgraded.

Hook Information

File Location wp-admin/includes/upgrade.php View on GitHub
Hook Type Action
Line Number 699

Hook Parameters

Type Name Description
int $wp_db_version The new $wp_db_version.
int $wp_current_db_version The old (current) $wp_db_version.

Usage Examples

Basic Usage
<?php
// Hook into wp_upgrade
add_action('wp_upgrade', 'my_custom_function', 10, 2);

function my_custom_function($wp_db_version, $wp_current_db_version) {
    // Your custom code here
}

Source Code Context

wp-admin/includes/upgrade.php:699 - How this hook is used in WordPress core
<?php
 694  		 * @since 3.9.0
 695  		 *
 696  		 * @param int $wp_db_version         The new $wp_db_version.
 697  		 * @param int $wp_current_db_version The old (current) $wp_db_version.
 698  		 */
 699  		do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );
 700  	}
 701  endif;
 702  
 703  /**
 704   * Functions to be called in installation and upgrade scripts.

PHP Documentation

<?php
/**
		 * Fires after a site is fully upgraded.
		 *
		 * @since 3.9.0
		 *
		 * @param int $wp_db_version         The new $wp_db_version.
		 * @param int $wp_current_db_version The old (current) $wp_db_version.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-admin/includes/upgrade.php
Related Hooks

Related hooks will be displayed here in future updates.