Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: after_db_upgrade

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
38 if ( get_option( 'db_upgraded' ) ) {
39      flush_rewrite_rules();
40      update_option( 'db_upgraded', false );
41
42      /**
43       * Fires on the next page load after a successful DB upgrade.
44       *
45       * @since 2.8.0
46       */
47      do_action( 'after_db_upgrade' );
48 } elseif ( get_option( 'db_version' ) != $wp_db_version && empty( $_POST ) ) {
49      if ( ! is_multisite() ) {
50           wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
51           exit;
52
53           /**
54            * Filters whether to attempt to perform the multisite DB upgrade routine.
55            *
56            * In single site, the user would be redirected to wp-admin/upgrade.php.