do_mu_upgrade

Filters whether to attempt to perform the multisite DB upgrade routine.

Description

apply_filters( 'do_mu_upgrade', (bool) $true ); 

In single site, the user would be redirected to wp-admin/upgrade.php. In multisite, the DB upgrade routine is automatically fired, but only when this filter returns true.

If the network is 50 sites or less, it will run every time. Otherwise, it will throttle itself to reduce load.

Parameters (1)

0. $true (bool) => true
Whether to perform the Multisite upgrade routine. Default true.

Usage

To run the hook, copy the example below.
  1. $true = apply_filters( 'do_mu_upgrade', $true ); 
  2.  
  3. if ( !empty( $true ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the do_mu_upgrade callback 
  2. function filter_do_mu_upgrade( $true ) { 
  3. // make filter magic happen here... 
  4. return $true
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'do_mu_upgrade', 'filter_do_mu_upgrade', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'do_mu_upgrade', 'filter_do_mu_upgrade', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/admin.php  
  1. } elseif ( apply_filters( 'do_mu_upgrade', true ) ) {