Make WordPress Core

Changeset 43921 for branches/5.0


Ignore:
Timestamp:
11/21/2018 04:34:28 PM (6 years ago)
Author:
mcsf
Message:

Warn users of Gutenberg plugin of its deactivation upon 5.0 upgrade.

Fixes #45073.

Location:
branches/5.0/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/about.php

    r43913 r43921  
    2525
    2626        <p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s introduces a robust new content creation experience.' ), $display_version ); ?></p>
    27         <p class="about-text">
    28             <a href="#classic-editor"><?php _e( 'Learn how to keep using the old editor.' ); ?></a>
    29         </p>
     27
     28        <?php if (
     29            // Was the Gutenberg plugin installed before upgrading to 5.0.x?
     30            get_option( 'upgrade_500_was_gutenberg_active' ) == '1'  &&
     31            current_user_can( 'activate_plugins' ) &&
     32            // Has it not been reactivated since?
     33            is_plugin_inactive( 'gutenberg/gutenberg.php' ) &&
     34            // Is it still installed?
     35            file_exists( WP_PLUGIN_DIR . '/gutenberg/gutenberg.php' )
     36        ) : ?>
     37            <div class="about-text" style="font-style:italic;">
     38                <?php printf( __( 'The Gutenberg plugin has been deactivated, as the features are now included in WordPress %1$s by default. If you&#8217;d like to continue to test the upcoming changes in the WordPress editing experience, please %2$sreactivate the Gutenberg plugin%3$s.' ), $display_version, '<a href="' . esc_url( self_admin_url( 'plugins.php?s=gutenberg&plugin_status=all' ) ) . '">', '</a>' ); ?>
     39            </div>
     40        <?php else : ?>
     41            <p class="about-text">
     42                <a href="#classic-editor"><?php _e( 'Learn how to keep using the old editor.' ); ?></a>
     43            </p>
     44        <?php endif; ?>
     45
    3046        <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    3147
     
    203219            </div>
    204220        </div>
    205        
     221
    206222        <div class="feature-section one-col cta">
    207223            <div class="col">
    208                 <a class="button button-primary button-hero" href="<?php echo esc_url( admin_url( 'post-new.php' ) ); ?>"><?php _e( 'Build your first post' ); ?></a>   
    209             </div>
    210         </div>
    211        
     224                <a class="button button-primary button-hero" href="<?php echo esc_url( admin_url( 'post-new.php' ) ); ?>"><?php _e( 'Build your first post' ); ?></a>
     225            </div>
     226        </div>
     227
    212228        <hr />
    213229
     
    251267        <div class="feature-section one-col cta">
    252268            <div class="col">
    253                 <a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo esc_url( admin_url( 'customize.php?theme=twentynineteen' ) ); ?>"><?php _e( 'Give Twenty Nineteen a try' ); ?></a>   
     269                <a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo esc_url( admin_url( 'customize.php?theme=twentynineteen' ) ); ?>"><?php _e( 'Give Twenty Nineteen a try' ); ?></a>
    254270            </div>
    255271        </div>
    256272
    257273        <hr />
    258            
     274
    259275        <div class="under-the-hood feature-section">
    260276            <div class="col">
     
    277293            </div>
    278294        </div>
    279        
     295
    280296        <div class="under-the-hood feature-section one-col cta">
    281297            <div class="col">
    282                 <a class="button button-primary button-hero" href="<?php echo esc_url( 'https://wordpress.org/gutenberg/handbook/' ); ?>"><?php _e( 'Learn how to get started' ); ?></a>   
     298                <a class="button button-primary button-hero" href="<?php echo esc_url( 'https://wordpress.org/gutenberg/handbook/' ); ?>"><?php _e( 'Learn how to get started' ); ?></a>
    283299            </div>
    284300        </div>
    285301
    286302        <hr />
    287        
     303
    288304        <div class="feature-section one-col" id="classic-editor">
    289305            <div class="col">
     
    291307            </div>
    292308        </div>
    293        
     309
    294310        <div class="full-width">
    295311            <img src="https://wordpress.org/gutenberg/files/2018/11/classic.png" alt="">
    296312        </div>
    297        
     313
    298314        <div class="feature-section one-col">
    299315            <div class="col">
     
    306322            </div>
    307323        </div>
    308        
     324
    309325        <hr />
    310326
  • branches/5.0/src/wp-admin/includes/upgrade.php

    r43912 r43921  
    18251825            return;
    18261826        }
     1827
     1828        $was_active = is_plugin_active( 'gutenberg/gutenberg.php' );
     1829        if ( $was_active ) {
     1830            // FIXME: Leave until 501 or 510 to clean up.
     1831            update_site_option( 'upgrade_500_was_gutenberg_active', '1' );
     1832        }
     1833
    18271834        deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
    18281835    }
Note: See TracChangeset for help on using the changeset viewer.