Make WordPress Core

Ticket #41316: 41316.15.diff

File 41316.15.diff, 20.2 KB (added by pento, 5 years ago)
  • src/wp-admin/css/common.css

    diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css
    index ac3a7c6b65..8613e822e7 100644
    a b img.emoji { 
    764764
    765765/* @todo can we combine these into a class or use an existing dashicon one? */
    766766.welcome-panel .welcome-panel-close:before,
     767.try-gutenberg-panel .try-gutenberg-panel-close:before,
    767768.tagchecklist .ntdelbutton .remove-tag-icon:before,
    768769#bulk-titles div a:before,
    769770.notice-dismiss:before {
  • src/wp-admin/css/dashboard.css

    diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css
    index f64cc92422..067e01fa2b 100644
    a b  
    9898}
    9999
    100100/* Welcome Panel */
    101 .welcome-panel {
     101.welcome-panel,
     102.try-gutenberg-panel {
    102103        position: relative;
    103104        overflow: auto;
    104105        margin: 16px 0;
     
    110111        line-height: 2.1em;
    111112}
    112113
    113 .welcome-panel h2 {
     114.welcome-panel h2,
     115.try-gutenberg-panel h2 {
    114116        margin: 0;
    115117        font-size: 21px;
    116118        font-weight: 400;
    117119        line-height: 1.2;
    118120}
    119121
    120 .welcome-panel h3 {
     122.welcome-panel h3,
     123.try-gutenberg-panel h3 {
    121124        margin: 1.33em 0 0;
    122125        font-size: 16px;
    123126}
    124127
    125 .welcome-panel li {
     128.welcome-panel li,
     129.try-gutenberg-panel li {
    126130        font-size: 14px;
    127131}
    128132
    129 .welcome-panel p {
     133.welcome-panel p,
     134.try-gutenberg-panel p {
    130135        color: #72777c;
    131136}
    132137
    133 .welcome-panel a {
     138.welcome-panel a,
     139.try-gutenberg-action a {
    134140        text-decoration: none;
    135141}
    136142
    137 .welcome-panel .about-description {
     143.welcome-panel .about-description,
     144.try-gutenberg-panel .about-description {
    138145        font-size: 16px;
    139146        margin: 0;
    140147}
    141148
    142 .welcome-panel .welcome-panel-close {
     149.try-gutenberg-panel-content hr {
     150        margin-top: 20px;
     151        margin-left: -23px;
     152        margin-right: -23px;
     153        border-top: 1px solid #f3f4f5;
     154        border-bottom: none;
     155}
     156
     157.welcome-panel .welcome-panel-close,
     158.try-gutenberg-panel .try-gutenberg-panel-close {
    143159        position: absolute;
     160        z-index: 10;
    144161        top: 10px;
    145162        right: 10px;
    146163        padding: 10px 15px 10px 21px;
     
    149166        text-decoration: none;
    150167}
    151168
    152 .welcome-panel .welcome-panel-close:before {
     169.welcome-panel .welcome-panel-close:before,
     170.try-gutenberg-panel .try-gutenberg-panel-close:before {
    153171        position: absolute;
    154172        top: 8px;
    155173        left: 0;
     
    164182        white-space: normal;
    165183}
    166184
    167 .welcome-panel-content {
    168         margin-left: 13px;
     185.welcome-panel-content,
     186.try-gutenberg-panel-content {
     187        margin: 0 13px;
    169188        max-width: 1500px;
    170189}
    171190
     191.try-gutenberg-panel img {
     192        margin-top: 28px;
     193        width: calc( 100% - 40px );
     194        border: 1px solid #f3f4f5;
     195}
     196
     197.try-gutenberg-panel .install-now.updating-message:before,
     198.try-gutenberg-panel .install-now.updated-message:before {
     199        margin-top: 11px;
     200}
     201
    172202.welcome-panel .welcome-panel-column-container {
    173203        clear: both;
    174204        position: relative;
     
    180210        float: left;
    181211}
    182212
     213.try-gutenberg-panel .try-gutenberg-panel-column > * {
     214        padding-right: 40px;
     215}
     216
    183217.ie8 .welcome-panel .welcome-panel-column {
    184218        min-width: 230px;
    185219}
     
    188222        width: 36%;
    189223}
    190224
     225.try-gutenberg-panel .try-gutenberg-panel-column-container {
     226        display: grid;
     227        grid-template-columns: 36% 32% 32%;
     228}
     229
     230.try-gutenberg-panel .try-gutenberg-panel-column:not(.try-gutenberg-panel-image-column) {
     231        display: grid;
     232        grid-template-rows: 48px auto 100px;
     233}
     234
    191235.welcome-panel-column p.hide-if-no-customize {
    192236        margin-top: 10px;
    193237}
    194238
    195 .welcome-panel-column p {
     239.welcome-panel-column p,
     240.try-gutenberg-panel-column p {
    196241        margin-top: 7px;
    197242        color: #444;
    198243}
     
    202247}
    203248
    204249.welcome-panel .welcome-panel-column ul {
    205         margin: 0.8em 1em 1em 0;
     250                margin: 0.8em 1em 1em 0;
    206251}
    207252
    208253.welcome-panel .welcome-panel-column li {
    a.rsswidget { 
    12071252        }
    12081253}
    12091254
     1255@media screen and (max-width: 1024px) {
     1256        .try-gutenberg-panel .try-gutenberg-panel-column-container {
     1257                grid-template-columns: 50% 50%;
     1258        }
     1259
     1260        .try-gutenberg-panel .try-gutenberg-panel-image-column {
     1261                display: none;
     1262        }
     1263}
     1264
    12101265@media screen and (max-width: 870px) {
    12111266        .welcome-panel .welcome-panel-column,
    12121267        .welcome-panel .welcome-panel-column:first-child {
    a.rsswidget { 
    12151270                width: 100%;
    12161271        }
    12171272
     1273        .try-gutenberg-panel .try-gutenberg-panel-column-container {
     1274                grid-template-columns: 100%;
     1275        }
     1276
    12181277        .welcome-panel .welcome-panel-column li {
    12191278                display: inline-block;
    12201279                margin-right: 13px;
    a.rsswidget { 
    12231282        .welcome-panel .welcome-panel-column ul {
    12241283                margin: 0.4em 0 0;
    12251284        }
    1226 
    12271285}
    12281286
    12291287@media screen and ( max-width: 782px ) {
    a.rsswidget { 
    12661324/* Smartphone */
    12671325@media screen and (max-width: 600px) {
    12681326        /* Keep the close icon from overlapping the Welcome text. */
    1269         .welcome-panel .welcome-panel-close {
     1327        .welcome-panel .welcome-panel-close,
     1328        .try-gutenberg-panel .try-gutenberg-panel-close {
    12701329                overflow: hidden;
    12711330                text-indent: 40px;
    12721331                white-space: nowrap;
    a.rsswidget { 
    12781337        }
    12791338
    12801339        /* Make the close icon larger for tappability. */
    1281         .welcome-panel .welcome-panel-close:before {
     1340        .welcome-panel .welcome-panel-close:before,
     1341        .try-gutenberg-panel .try-gutenberg-panel-close:before {
    12821342                font-size: 20px;
    12831343                top: 5px;
    12841344                left: -35px;
  • src/wp-admin/includes/ajax-actions.php

    diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
    index 8fb348c6d3..eb14c51f69 100644
    a b function wp_ajax_update_welcome_panel() { 
    14841484        wp_die( 1 );
    14851485}
    14861486
     1487/**
     1488 * Ajax handler for updating whether to display the Try Gutenberg panel.
     1489 *
     1490 * @since 4.9.6
     1491 */
     1492function wp_ajax_update_try_gutenberg_panel() {
     1493        check_ajax_referer( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce' );
     1494
     1495        update_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', empty( $_POST['visible'] ) ? 0 : 1 );
     1496
     1497        wp_die( 1 );
     1498}
     1499
    14871500/**
    14881501 * Ajax handler for retrieving menu meta boxes.
    14891502 *
  • src/wp-admin/includes/class-wp-screen.php

    diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
    index 0146b56cbf..84cbd9164f 100644
    a b final class WP_Screen { 
    10201020                                        update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
    10211021                                } else {
    10221022                                        $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    1023                                         if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
     1023                                        if ( '' === $welcome_checked ) {
     1024                                                $welcome_checked = '1';
     1025                                        }
     1026                                        if ( '2' === $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
    10241027                                                $welcome_checked = false;
    10251028                                        }
    10261029                                }
    final class WP_Screen { 
    10281031                                echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
    10291032                                echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n";
    10301033                        }
     1034
     1035                        if ( 'dashboard' === $this->id && has_action( 'try_gutenberg_panel' ) ) {
     1036                                if ( isset( $_GET['try_gutenberg'] ) ) {
     1037                                        $try_gutenberg_checked = empty( $_GET['try_gutenberg'] ) ? 0 : 1;
     1038                                        update_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', $try_gutenberg_checked );
     1039                                } else {
     1040                                        $try_gutenberg_checked = get_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', true );
     1041                                        if ( '' === $try_gutenberg_checked ) {
     1042                                                $try_gutenberg_checked = '1';
     1043                                        }
     1044                                        if ( '2' === $try_gutenberg_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
     1045                                                $try_gutenberg_checked = false;
     1046                                        }
     1047                                }
     1048                                echo '<label for="wp_try_gutenberg_panel-hide">';
     1049                                echo '<input type="checkbox" id="wp_try_gutenberg_panel-hide"' . checked( (bool) $try_gutenberg_checked, true, false ) . ' />';
     1050                                echo __( 'New Editor' ) . "</label>\n";
     1051                        }
    10311052                ?>
    10321053                </fieldset>
    10331054                <?php
  • src/wp-admin/includes/dashboard.php

    diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php
    index fa1d2ffad4..67de1e852c 100644
    a b function wp_welcome_panel() { 
    16191619        </div>
    16201620        <?php
    16211621}
     1622
     1623/**
     1624 * Displays a Try Gutenberg Panel, to introduce people to Gutenberg
     1625 *
     1626 * @since 4.9.6
     1627 */
     1628function wp_try_gutenberg_panel() {
     1629        $plugins = get_plugins();
     1630        $action = $url = $classes = '';
     1631        $classic_action = $classic_url = $classic_classes = '';
     1632
     1633        if ( current_user_can( 'install_plugins' ) ) {
     1634                if ( empty( $plugins['gutenberg/gutenberg.php'] ) ) {
     1635                        $action = __( 'Install Gutenberg' );
     1636                        $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' );
     1637                        $classes = ' install-now';
     1638                } else if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) {
     1639                        $action = __( 'Activate Gutenberg' );
     1640                        $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php&from=try-gutenberg' ), 'activate-plugin_gutenberg/gutenberg.php' );
     1641                        $classes = ' activate-now';
     1642                }
     1643
     1644                if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {
     1645                        $classic_action = __( 'Install the Classic Editor' );
     1646                        $classic_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' );
     1647                        $classic_classes = ' install-now';
     1648                } else if ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {
     1649                        $classic_action = __( 'Activate the Classic Editor' );
     1650                        $classic_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php&from=try-gutenberg' ), 'activate-plugin_classic-editor/classic-editor.php' );
     1651                        $classic_classes = ' activate-now';
     1652                } else {
     1653                        $classic_action = __( 'The Classic Editor is activated' );
     1654                        $classic_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php&from=try-gutenberg' ), 'activate-plugin_classic-editor/classic-editor.php' );;
     1655                        $classic_classes = ' button-disabled install-now updated-message';
     1656                }
     1657        }
     1658
     1659        if ( current_user_can( 'edit_posts' ) && is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
     1660                $action = __( 'Try Gutenberg' );
     1661                $url = admin_url( 'admin.php?page=gutenberg' );
     1662        }
     1663
     1664        ?>
     1665        <div class="try-gutenberg-panel-content">
     1666                <h2><?php _e( 'A new, modern publishing experience is coming soon.' ); ?></h2>
     1667
     1668                <p class="about-description"><?php _e( "Take your words, media, and layout in new directions with Gutenberg, the WordPress editor we're currently building." ); ?></p>
     1669
     1670                <hr />
     1671
     1672                <div class="try-gutenberg-panel-column-container">
     1673                        <div class="try-gutenberg-panel-column try-gutenberg-panel-image-column">
     1674                                <picture>
     1675                                        <source srcset="about:blank" media="(max-width: 1024px)">
     1676                                        <img src="https://s.w.org/images/core/gutenberg-screenshot.gif?<?php echo date( 'Ymd' ); ?>" alt="<?php esc_attr_e( 'Gutenberg animated preview' ); ?>" />
     1677                                </picture>
     1678                        </div>
     1679                        <div class="try-gutenberg-panel-column plugin-card-gutenberg">
     1680
     1681                                <h3><?php _e( 'Test the new editor today.' ); ?></h3>
     1682
     1683                                <p>
     1684                                        <?php _e( "You can take Gutenberg for a spin (and share your feedback, if you’d like) before we officially release it, by installing it as a plugin." ); ?>
     1685                                        <?php
     1686                                                printf(
     1687                                                        /* translators: 1: Gutenberg call for testing handbook link, 2: Gutenberg GitHub repository issues link, 3: Gutenberg GitHub repository CONTRIBUTING.md link */
     1688                                                        __( 'You can help by <a href="%1$s">testing</a>, <a href="%2$s">filing bugs</a>, or contributing on the <a href="%3$s">GitHub repository</a>.' ),
     1689                                                        'https://make.wordpress.org/test/handbook/call-for-testing/gutenberg-testing/',
     1690                                                        'https://github.com/WordPress/gutenberg/issues',
     1691                                                        'https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md'
     1692                                                );
     1693                                        ?>
     1694                                </p>
     1695
     1696                                        <?php if ( $action ) { ?>
     1697                                                <div class="try-gutenberg-action">
     1698                                                        <p><a class="button button-primary button-hero<?php echo $classes; ?>" href="<?php echo esc_url( $url ); ?>" data-name="<?php esc_attr_e( 'Gutenberg' ); ?>" data-slug="gutenberg"><?php echo $action; ?></a></p>
     1699                                                        <p>
     1700                                                                <?php
     1701                                                                        printf(
     1702                                                                                /* translators: Link to https://wordpress.org/gutenberg/ */
     1703                                                                                __( '<a href="%s">Learn more about Gutenberg</a>' ),
     1704                                                                                'https://wordpress.org/gutenberg/'
     1705                                                                        );
     1706                                                                ?>
     1707                                                        </p>
     1708                                                </div>
     1709                                        <?php } ?>
     1710                        </div>
     1711
     1712                        <div class="try-gutenberg-panel-column plugin-card-classic-editor">
     1713
     1714                                <h3><?php _e( 'Prepare for the transition.' ); ?></h3>
     1715
     1716                                <p>
     1717                                        <?php _e( 'The new editor will be enabled by default in the next major release of WordPress.' ); ?>
     1718                                        <?php _e( "If you're not sure about how compatible your current themes and plugins are, we've got you covered." ); ?>
     1719                                        <?php
     1720                                                printf(
     1721                                                        /* translators: Link to the Classic Editor plugin page */
     1722                                                        __( 'You can install the <a href="%s">Classic Editor plugin</a> now, which will allow you to continue using the classic editor until everything is ready.' ),
     1723                                                        'http://wordpress.org/plugins/classic-editor'
     1724                                                );
     1725                                        ?>
     1726                                </p>
     1727
     1728                                <?php if ( $classic_action ) { ?>
     1729                                        <div class="try-gutenberg-action">
     1730                                                <p><a class="button button-secondary button-hero<?php echo $classic_classes; ?>" href="<?php echo esc_url( $classic_url ); ?>" data-name="<?php esc_attr_e( 'Classic Editor' ); ?>" data-slug="classic-editor"><?php echo $classic_action; ?></a></p>
     1731                                        </div>
     1732                                <?php } ?>
     1733                        </div>
     1734                </div>
     1735        </div>
     1736        <?php
     1737}
  • src/wp-admin/index.php

    diff --git a/src/wp-admin/index.php b/src/wp-admin/index.php
    index 783a43b23f..f005388ba2 100644
    a b include( ABSPATH . 'wp-admin/admin-header.php' ); 
    103103<div class="wrap">
    104104        <h1><?php echo esc_html( $title ); ?></h1>
    105105
     106<?php if ( has_action( 'try_gutenberg_panel' ) ) :
     107        $classes = 'try-gutenberg-panel';
     108
     109        $option = get_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', true );
     110        // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
     111        $hide = '0' === $option || ( '2' === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) );
     112        if ( $hide )
     113                $classes .= ' hidden'; ?>
     114
     115        <div id="try-gutenberg-panel" class="<?php echo esc_attr( $classes ); ?>">
     116                <?php wp_nonce_field( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce', false ); ?>
     117                <a class="try-gutenberg-panel-close" href="<?php echo esc_url( admin_url( '?try_gutenberg=0' ) ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the Try Gutenberg panel' ); ?>"><?php _e( 'Dismiss' ); ?></a>
     118                <?php
     119                /**
     120                 * Add content to the Try Gutenberg panel on the admin dashboard.
     121                 *
     122                 * To remove the Try Gutenberg panel, use remove_action():
     123                 *
     124                 *     remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
     125                 *
     126                 * @since 4.9.6
     127                 */
     128                do_action( 'try_gutenberg_panel' );
     129                ?>
     130        </div>
     131<?php endif; ?>
    106132<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
    107133        $classes = 'welcome-panel';
    108134
    109135        $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    110136        // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
    111         $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
     137        $hide = '0' === $option || ( '2' === $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
    112138        if ( $hide )
    113139                $classes .= ' hidden'; ?>
    114140
  • src/wp-admin/js/dashboard.js

    diff --git a/src/wp-admin/js/dashboard.js b/src/wp-admin/js/dashboard.js
    index a6b56c37ef..2ae6455244 100644
    a b jQuery(document).ready( function($) { 
    3131                updateWelcomePanel( this.checked ? 1 : 0 );
    3232        });
    3333
     34        var tryGutenbergPanel = $( '#try-gutenberg-panel' ),
     35                tryGutenbergPanelHide = $('#wp_try_gutenberg_panel-hide'),
     36                updateTryGutenbergPanel, installGutenbergSuccess;
     37
     38        updateTryGutenbergPanel = function( visible ) {
     39                $.post( ajaxurl, {
     40                        action: 'update-try-gutenberg-panel',
     41                        visible: visible,
     42                        trygutenbergpanelnonce: $( '#trygutenbergpanelnonce' ).val()
     43                });
     44        };
     45
     46        installGutenbergSuccess = function( response ) {
     47                response.activateUrl += '&from=try-gutenberg';
     48                response.activateLabel = wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName );
     49                wp.updates.installPluginSuccess( response );
     50        };
     51
     52        if ( tryGutenbergPanel.hasClass( 'hidden' ) && tryGutenbergPanelHide.prop( 'checked' ) ) {
     53                tryGutenbergPanel.removeClass( 'hidden' );
     54        }
     55
     56        $( '.try-gutenberg-panel-close, .try-gutenberg-panel-dismiss a', tryGutenbergPanel ).click( function( e ) {
     57                e.preventDefault();
     58                tryGutenbergPanel.addClass( 'hidden' );
     59                updateTryGutenbergPanel( 0 );
     60                $('#wp_try_gutenberg_panel-hide').prop( 'checked', false );
     61        });
     62
     63        tryGutenbergPanelHide.click( function() {
     64                tryGutenbergPanel.toggleClass( 'hidden', ! this.checked );
     65                updateTryGutenbergPanel( this.checked ? 1 : 0 );
     66        });
     67
     68        tryGutenbergPanel.on( 'click', '.install-now', function( e ) {
     69                e.preventDefault();
     70                var args = {
     71                        slug: $( e.target ).data( 'slug' ),
     72                        success: installGutenbergSuccess
     73                };
     74                wp.updates.installPlugin( args );
     75        } );
     76
    3477        // These widgets are sometimes populated via ajax
    3578        ajaxWidgets = ['dashboard_primary'];
    3679
  • src/wp-admin/js/updates.js

    diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js
    index 22229a6f51..a39ceeadeb 100644
    a b  
    585585
    586586                $message
    587587                        .removeClass( 'updating-message' )
    588                         .addClass( 'updated-message installed button-disabled' )
     588                        .addClass( 'updated-message installed' )
    589589                        .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) )
    590590                        .text( wp.updates.l10n.pluginInstalled );
    591591
     592                if ( $message.hasClass( 'button-primary' ) ) {
     593                        $message.addClass( 'button-primary-disabled' );
     594                } else {
     595                        $message.addClass( 'button-disabled' );
     596                }
     597
    592598                wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
    593599
    594600                $document.trigger( 'wp-plugin-install-success', response );
     
    597603                        setTimeout( function() {
    598604
    599605                                // Transform the 'Install' button into an 'Activate' button.
    600                                 $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' )
     606                                $message.removeClass( 'install-now installed button-primary-disabled button-secondary-disabled button-disabled updated-message' )
     607                                        .addClass( 'activate-now' )
    601608                                        .attr( 'href', response.activateUrl )
    602609                                        .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) )
    603                                         .text( wp.updates.l10n.activatePlugin );
     610                                        .text( response.activateLabel || wp.updates.l10n.activatePlugin );
    604611                        }, 1000 );
    605612                }
    606613        };
  • src/wp-admin/plugins.php

    diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php
    index b92a7964e6..50e4114503 100644
    a b if ( $action ) { 
    6565                                wp_redirect( self_admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix
    6666                        } else if ( isset($_GET['from']) && 'press-this' == $_GET['from'] ) {
    6767                                wp_redirect( self_admin_url( "press-this.php") );
     68                        } else if ( isset( $_GET['from'] ) && 'try-gutenberg' == $_GET['from'] ) {
     69                                if ( 'gutenberg/gutenberg.php' === $plugin ) {
     70                                        wp_redirect( self_admin_url( "admin.php?page=gutenberg" ) );
     71                                } else {
     72                                        wp_redirect( self_admin_url() );
     73                                }
    6874                        } else {
    6975                                wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
    7076                        }
  • src/wp-includes/default-filters.php

    diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php
    index e012beb182..fb8af82daf 100644
    a b add_action( 'transition_post_status', '_transition_post_status', 
    318318add_action( 'transition_post_status',     '_update_term_count_on_transition_post_status', 10, 3 );
    319319add_action( 'comment_form',               'wp_comment_form_unfiltered_html_nonce'          );
    320320add_action( 'admin_init',                 'send_frame_options_header',               10, 0 );
     321add_action( 'try_gutenberg_panel',        'wp_try_gutenberg_panel'                         );
    321322add_action( 'welcome_panel',              'wp_welcome_panel'                               );
    322323
    323324// Privacy