Make WordPress Core

Changeset 41978


Ignore:
Timestamp:
10/23/2017 08:47:27 PM (9 years ago)
Author:
jorbin
Message:

Dashboard: Remove "Try Gutenberg" callout.

Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.

Reverts [41931] [41900] [41896] [41895]
See #41316

Location:
trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-ajax.php

    r41926 r41978  
    6565        'generate-password', 'save-wporg-username', 'delete-plugin', 'search-plugins',
    6666        'search-install-plugins', 'activate-plugin', 'update-theme', 'delete-theme', 'install-theme',
    67         'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file', 'update-try-gutenberg-panel',
     67        'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file',
    6868);
    6969
  • trunk/src/wp-admin/css/common.css

    r41895 r41978  
    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,
    768767.tagchecklist .ntdelbutton .remove-tag-icon:before,
    769768#bulk-titles div a:before,
  • trunk/src/wp-admin/css/dashboard.css

    r41900 r41978  
    9999
    100100/* Welcome Panel */
    101 .welcome-panel,
    102 .try-gutenberg-panel {
     101.welcome-panel {
    103102        position: relative;
    104103        overflow: auto;
     
    112111}
    113112
    114 .welcome-panel h2,
    115 .try-gutenberg-panel h2 {
     113.welcome-panel h2 {
    116114        margin: 0;
    117115        font-size: 21px;
     
    120118}
    121119
    122 .welcome-panel h3,
    123 .try-gutenberg-panel h3 {
     120.welcome-panel h3 {
    124121        margin: 1.33em 0 0;
    125122        font-size: 16px;
    126123}
    127124
    128 .welcome-panel li,
    129 .try-gutenberg-panel li {
     125.welcome-panel li {
    130126        font-size: 14px;
    131127}
    132128
    133 .welcome-panel p,
    134 .try-gutenberg-panel p,
    135 .try-gutenberg-panel-column p.about-description {
     129.welcome-panel p {
    136130        color: #72777c;
    137131}
    138132
    139 .welcome-panel a,
    140 .try-gutenberg-panel a {
     133.welcome-panel a {
    141134        text-decoration: none;
    142135}
     
    147140}
    148141
    149 .try-gutenberg-panel .about-description {
    150         font-size: 16px;
    151         margin-top: 1.33em;
    152 }
    153 
    154 .welcome-panel .welcome-panel-close,
    155 .try-gutenberg-panel .try-gutenberg-panel-close {
     142.welcome-panel .welcome-panel-close {
    156143        position: absolute;
    157         z-index: 10;
    158144        top: 10px;
    159145        right: 10px;
     
    164150}
    165151
    166 .welcome-panel .welcome-panel-close:before,
    167 .try-gutenberg-panel .try-gutenberg-panel-close:before {
     152.welcome-panel .welcome-panel-close:before {
    168153        position: absolute;
    169154        top: 8px;
     
    180165}
    181166
    182 .welcome-panel-content,
    183 .try-gutenberg-panel-content {
    184         margin: 0 13px;
     167.welcome-panel-content {
     168        margin-left: 13px;
    185169        max-width: 1500px;
    186170}
    187171
    188 .try-gutenberg-panel img {
    189         max-width: 360px;
    190         width: 100%;
    191         border: 1px solid #f3f4f5;
    192 }
    193 
    194 .try-gutenberg-panel .install-now.updating-message:before,
    195 .try-gutenberg-panel .install-now.updated-message:before {
    196         margin-top: 11px;
    197 }
    198 
    199 .welcome-panel .welcome-panel-column-container,
    200 .try-gutenberg-panel .try-gutenberg-panel-column-container {
     172.welcome-panel .welcome-panel-column-container {
    201173        clear: both;
    202174        position: relative;
    203175}
    204176
    205 .welcome-panel .welcome-panel-column,
    206 .try-gutenberg-panel .try-gutenberg-panel-column {
     177.welcome-panel .welcome-panel-column {
    207178        width: 32%;
    208179        min-width: 200px;
     
    210181}
    211182
    212 .try-gutenberg-panel .try-gutenberg-panel-column {
    213         width: calc( 32% - 20px );
    214         padding: 0 20px 20px 0;
    215 }
    216 
    217 .ie8 .welcome-panel .welcome-panel-column,
    218 .ie8 .try-gutenberg-panel .try-gutenberg-panel-column {
     183.ie8 .welcome-panel .welcome-panel-column {
    219184        min-width: 230px;
    220185}
    221186
    222 .welcome-panel .welcome-panel-column:first-child
    223 .try-gutenberg-panel .try-gutenberg-panel-column:first-child {
     187.welcome-panel .welcome-panel-column:first-child {
    224188        width: 36%;
    225189}
     
    229193}
    230194
    231 .welcome-panel-column p,
    232 .try-gutenberg-panel-column p {
     195.welcome-panel-column p {
    233196        margin-top: 7px;
    234197        color: #444;
     
    239202}
    240203
    241 .welcome-panel .welcome-panel-column ul,
    242 .try-gutenberg-panel .try-gutenberg-panel-column ul {
    243                 margin: 0.8em 1em 1em 0;
    244 }
    245 
    246 .welcome-panel .welcome-panel-column li,
    247 .try-gutenberg-panel .try-gutenberg-panel-column li {
     204.welcome-panel .welcome-panel-column ul {
     205        margin: 0.8em 1em 1em 0;
     206}
     207
     208.welcome-panel .welcome-panel-column li {
    248209        line-height: 16px;
    249210        list-style-type: none;
     
    12471208}
    12481209
    1249 @media screen and (max-width: 1024px) {
    1250         .try-gutenberg-panel .try-gutenberg-panel-image-column {
    1251                 display: none;
    1252         }
    1253 
    1254         .try-gutenberg-panel .try-gutenberg-panel-column {
    1255                 width: calc( 49% - 20px );
    1256         }
    1257 }
    1258 
    12591210@media screen and (max-width: 870px) {
    12601211        .welcome-panel .welcome-panel-column,
    1261         .try-gutenberg-panel .try-gutenberg-panel-column,
    12621212        .welcome-panel .welcome-panel-column:first-child {
    12631213                display: block;
     
    12661216        }
    12671217
    1268         .try-gutenberg-panel .try-gutenberg-panel-image-column {
    1269                 display: none;
    1270         }
    1271 
    12721218        .welcome-panel .welcome-panel-column li {
    12731219                display: inline-block;
     
    12781224                margin: 0.4em 0 0;
    12791225        }
     1226
    12801227}
    12811228
     
    13201267@media screen and (max-width: 600px) {
    13211268        /* Keep the close icon from overlapping the Welcome text. */
    1322         .welcome-panel .welcome-panel-close,
    1323         .try-gutenberg-panel .try-gutenberg-panel-close {
     1269        .welcome-panel .welcome-panel-close {
    13241270                overflow: hidden;
    13251271                text-indent: 40px;
     
    13331279
    13341280        /* Make the close icon larger for tappability. */
    1335         .welcome-panel .welcome-panel-close:before,
    1336         .try-gutenberg-panel .try-gutenberg-panel-close:before {
     1281        .welcome-panel .welcome-panel-close:before {
    13371282                font-size: 20px;
    13381283                top: 5px;
  • trunk/src/wp-admin/includes/ajax-actions.php

    r41913 r41978  
    14811481
    14821482/**
    1483  * Ajax handler for updating whether to display the Try Gutenberg panel.
    1484  *
    1485  * @since 4.9.0
    1486  */
    1487 function wp_ajax_update_try_gutenberg_panel() {
    1488         check_ajax_referer( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce' );
    1489 
    1490         update_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', empty( $_POST['visible'] ) ? 0 : 1 );
    1491 
    1492         wp_die( 1 );
    1493 }
    1494 
    1495 /**
    14961483 * Ajax handler for retrieving menu meta boxes.
    14971484 *
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r41895 r41978  
    10211021                                } else {
    10221022                                        $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    1023                                         if ( '' === $welcome_checked ) {
    1024                                                 $welcome_checked = '1';
    1025                                         }
    1026                                         if ( '2' === $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
     1023                                        if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
    10271024                                                $welcome_checked = false;
    10281025                                        }
     
    10311028                                echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
    10321029                                echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n";
    1033                         }
    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";
    10511030                        }
    10521031                ?>
  • trunk/src/wp-admin/includes/dashboard.php

    r41931 r41978  
    16201620        <?php
    16211621}
    1622 
    1623 /**
    1624  * Displays a Try Gutenberg Panel, to introduce people to Gutenberg
    1625  *
    1626  * @since 4.9.0
    1627  */
    1628 function wp_try_gutenberg_panel() {
    1629         $plugins = get_plugins();
    1630         $action = $url = $classes = '';
    1631 
    1632         if ( current_user_can( 'install_plugins' ) && empty( $plugins['gutenberg/gutenberg.php'] ) ) {
    1633                 $action = __( 'Install Today' );
    1634                 $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' );
    1635                 $classes = ' install-now';
    1636         } else if ( current_user_can( 'install_plugins' ) && is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) {
    1637                 $action = __( 'Activate Today' );
    1638                 $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php&from=try-gutenberg' ), 'activate-plugin_gutenberg/gutenberg.php' );
    1639                 $classes = ' activate-now';
    1640         } else if ( current_user_can( 'edit_posts' ) && is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
    1641                 $action = __( 'Try Today' );
    1642                 $url = admin_url( 'admin.php?page=gutenberg-demo' );
    1643         }
    1644 
    1645         ?>
    1646         <div class="try-gutenberg-panel-content plugin-card-gutenberg">
    1647                 <div class="try-gutenberg-panel-column-container">
    1648                         <div class="try-gutenberg-panel-column try-gutenberg-panel-image-column">
    1649                                 <img src="https://s.w.org/images/core/gutenberg-screenshot.gif?<?php echo date( 'Ymd' ); ?>" alt="<?php esc_attr_e( 'Gutenberg animated preview' ); ?>" />
    1650                         </div>
    1651                         <h2><?php _e( 'Try the new editing experience' ); ?></h2>
    1652                         <div class="try-gutenberg-panel-column">
    1653                                 <p class="about-description"><?php _e( 'WordPress is working on a better way to control your content. How about giving it a try early?' ); ?></p>
    1654                                 <?php if ( $action ) { ?>
    1655                                         <p><a class="button button-primary button-hero<?php echo $classes; ?>" href="<?php echo esc_url( $url ); ?>"><?php echo $action; ?></a></p>
    1656                                 <?php } ?>
    1657                         </div>
    1658                         <div class="try-gutenberg-panel-column try-gutenberg-panel-last">
    1659                                 <h3><?php _e( 'Want to get involved?' ); ?></h3>
    1660                                 <ul>
    1661                                         <li><?php
    1662                                                 printf( __( 'Learn more about the project <a href="%s">codenamed Gutenberg</a>.' ),
    1663                                                         'https://wordpress.org/gutenberg/'
    1664                                                 );
    1665                                         ?></li>
    1666                                         <li><?php
    1667                                                 printf( __( 'Help <a href="%1$s">with testing</a>, or contribute on the <a href="%2$s">GitHub repository</a>.' ),
    1668                                                         __( 'https://make.wordpress.org/test/handbook/call-for-testing/gutenberg-testing/' ),
    1669                                                         'https://github.com/WordPress/gutenberg/'
    1670                                                 );
    1671                                         ?></li>
    1672                                 </ul>
    1673                         </div>
    1674                 </div>
    1675         </div>
    1676         <?php
    1677 }
  • trunk/src/wp-admin/index.php

    r41895 r41978  
    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.0
    127                  */
    128                 do_action( 'try_gutenberg_panel' );
    129                 ?>
    130         </div>
    131 <?php endif; ?>
    132106<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
    133107        $classes = 'welcome-panel';
     
    135109        $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    136110        // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
    137         $hide = '0' === $option || ( '2' === $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
     111        $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
    138112        if ( $hide )
    139113                $classes .= ' hidden'; ?>
  • trunk/src/wp-admin/js/dashboard.js

    r41896 r41978  
    3131                updateWelcomePanel( this.checked ? 1 : 0 );
    3232        });
    33 
    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                 wp.updates.installPluginSuccess( response );
    49         };
    50 
    51         if ( tryGutenbergPanel.hasClass('hidden') && tryGutenbergPanelHide.prop('checked') ) {
    52                 tryGutenbergPanel.removeClass('hidden');
    53         }
    54 
    55         $('.try-gutenberg-panel-close, .try-gutenberg-panel-dismiss a', tryGutenbergPanel).click( function(e) {
    56                 e.preventDefault();
    57                 tryGutenbergPanel.addClass('hidden');
    58                 updateTryGutenbergPanel( 0 );
    59                 $('#wp_try_gutenberg_panel-hide').prop('checked', false);
    60         });
    61 
    62         tryGutenbergPanelHide.click( function() {
    63                 tryGutenbergPanel.toggleClass('hidden', ! this.checked );
    64                 updateTryGutenbergPanel( this.checked ? 1 : 0 );
    65         });
    66 
    67         tryGutenbergPanel.on( 'click', '.install-now', function( e ) {
    68                 e.preventDefault();
    69                 var args = {
    70                         slug: 'gutenberg',
    71                         success: installGutenbergSuccess
    72                 };
    73                 wp.updates.installPlugin( args );
    74         } );
    7533
    7634        // These widgets are sometimes populated via ajax
  • trunk/src/wp-admin/js/updates.js

    r41895 r41978  
    586586                $message
    587587                        .removeClass( 'updating-message' )
    588                         .addClass( 'updated-message installed' )
     588                        .addClass( 'updated-message installed button-disabled' )
    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 if ( $message.hasClass( 'button-secondary' ) ) {
    595                         $message.addClass( 'button-secondary-disabled' );
    596                 } else {
    597                         $message.addClass( 'button-disabled' );
    598                 }
    599 
    600592                wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
    601593
     
    606598
    607599                                // Transform the 'Install' button into an 'Activate' button.
    608                                 $message.removeClass( 'install-now installed button-primary-disabled button-secondary-disabled button-disabled updated-message' )
    609                                         .addClass( 'activate-now button-primary' )
     600                                $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' )
    610601                                        .attr( 'href', response.activateUrl )
    611602                                        .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) )
  • trunk/src/wp-admin/plugins.php

    r41895 r41978  
    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                                 wp_redirect( self_admin_url( "admin.php?page=gutenberg-demo") );
    7068                        } else {
    7169                                wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
  • trunk/src/wp-includes/default-filters.php

    r41963 r41978  
    319319add_action( 'comment_form',               'wp_comment_form_unfiltered_html_nonce'          );
    320320add_action( 'admin_init',                 'send_frame_options_header',               10, 0 );
    321 add_action( 'try_gutenberg_panel',        'wp_try_gutenberg_panel'                         );
    322321add_action( 'welcome_panel',              'wp_welcome_panel'                               );
    323322
Note: See TracChangeset for help on using the changeset viewer.