maintenance_mode example

/* * Only start maintenance mode if: * - running Multisite and there are one or more themes specified, OR * - a theme with an update available is currently in use. * @todo For multisite, maintenance mode should only kick in for individual sites if at all possible. */
        $maintenance = ( is_multisite() && ! empty( $themes ) );
        foreach ( $themes as $theme ) {
            $maintenance = $maintenance || get_stylesheet() === $theme || get_template() === $theme;
        }
        if ( $maintenance ) {
            $this->maintenance_mode( true );
        }

        $results = array();

        $this->update_count   = count( $themes );
        $this->update_current = 0;
        foreach ( $themes as $theme ) {
            $this->update_current++;

            $this->skin->theme_info = $this->theme_info( $theme );

            
/* * Only start maintenance mode if: * - running Multisite and there are one or more plugins specified, OR * - a plugin with an update available is currently active. * @todo For multisite, maintenance mode should only kick in for individual sites if at all possible. */
        $maintenance = ( is_multisite() && ! empty( $plugins ) );
        foreach ( $plugins as $plugin ) {
            $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin ] ) );
        }
        if ( $maintenance ) {
            $this->maintenance_mode( true );
        }

        $results = array();

        $this->update_count   = count( $plugins );
        $this->update_current = 0;
        foreach ( $plugins as $plugin ) {
            $this->update_current++;
            $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true );

            if ( ! isset( $current->response[ $plugin ] ) ) {
                
Home | Imprint | This part of the site doesn't use cookies.