diff --git a/src/wp-admin/admin-ajax.php b/src/wp-admin/admin-ajax.php index 579f985c4a..8a1533254f 100644 --- a/src/wp-admin/admin-ajax.php +++ b/src/wp-admin/admin-ajax.php @@ -64,7 +64,7 @@ $core_actions_post = array( 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'crop-image', 'generate-password', 'save-wporg-username', 'delete-plugin', 'search-plugins', 'search-install-plugins', 'activate-plugin', 'update-theme', 'delete-theme', 'install-theme', - 'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file', 'update-try-gutenberg-panel', + 'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file', ); // Deprecated diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 737983179d..a0beadd330 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -764,7 +764,6 @@ img.emoji { /* @todo can we combine these into a class or use an existing dashicon one? */ .welcome-panel .welcome-panel-close:before, -.try-gutenberg-panel .try-gutenberg-panel-close:before, .tagchecklist .ntdelbutton .remove-tag-icon:before, #bulk-titles div a:before, .notice-dismiss:before { diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index 0b803e1844..f64cc92422 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -98,8 +98,7 @@ } /* Welcome Panel */ -.welcome-panel, -.try-gutenberg-panel { +.welcome-panel { position: relative; overflow: auto; margin: 16px 0; @@ -111,33 +110,27 @@ line-height: 2.1em; } -.welcome-panel h2, -.try-gutenberg-panel h2 { +.welcome-panel h2 { margin: 0; font-size: 21px; font-weight: 400; line-height: 1.2; } -.welcome-panel h3, -.try-gutenberg-panel h3 { +.welcome-panel h3 { margin: 1.33em 0 0; font-size: 16px; } -.welcome-panel li, -.try-gutenberg-panel li { +.welcome-panel li { font-size: 14px; } -.welcome-panel p, -.try-gutenberg-panel p, -.try-gutenberg-panel-column p.about-description { +.welcome-panel p { color: #72777c; } -.welcome-panel a, -.try-gutenberg-panel a { +.welcome-panel a { text-decoration: none; } @@ -146,15 +139,8 @@ margin: 0; } -.try-gutenberg-panel .about-description { - font-size: 16px; - margin-top: 1.33em; -} - -.welcome-panel .welcome-panel-close, -.try-gutenberg-panel .try-gutenberg-panel-close { +.welcome-panel .welcome-panel-close { position: absolute; - z-index: 10; top: 10px; right: 10px; padding: 10px 15px 10px 21px; @@ -163,8 +149,7 @@ text-decoration: none; } -.welcome-panel .welcome-panel-close:before, -.try-gutenberg-panel .try-gutenberg-panel-close:before { +.welcome-panel .welcome-panel-close:before { position: absolute; top: 8px; left: 0; @@ -179,48 +164,27 @@ white-space: normal; } -.welcome-panel-content, -.try-gutenberg-panel-content { - margin: 0 13px; +.welcome-panel-content { + margin-left: 13px; max-width: 1500px; } -.try-gutenberg-panel img { - max-width: 360px; - width: 100%; - border: 1px solid #f3f4f5; -} - -.try-gutenberg-panel .install-now.updating-message:before, -.try-gutenberg-panel .install-now.updated-message:before { - margin-top: 11px; -} - -.welcome-panel .welcome-panel-column-container, -.try-gutenberg-panel .try-gutenberg-panel-column-container { +.welcome-panel .welcome-panel-column-container { clear: both; position: relative; } -.welcome-panel .welcome-panel-column, -.try-gutenberg-panel .try-gutenberg-panel-column { +.welcome-panel .welcome-panel-column { width: 32%; min-width: 200px; float: left; } -.try-gutenberg-panel .try-gutenberg-panel-column { - width: calc( 32% - 20px ); - padding: 0 20px 20px 0; -} - -.ie8 .welcome-panel .welcome-panel-column, -.ie8 .try-gutenberg-panel .try-gutenberg-panel-column { +.ie8 .welcome-panel .welcome-panel-column { min-width: 230px; } -.welcome-panel .welcome-panel-column:first-child -.try-gutenberg-panel .try-gutenberg-panel-column:first-child { +.welcome-panel .welcome-panel-column:first-child { width: 36%; } @@ -228,8 +192,7 @@ margin-top: 10px; } -.welcome-panel-column p, -.try-gutenberg-panel-column p { +.welcome-panel-column p { margin-top: 7px; color: #444; } @@ -238,13 +201,11 @@ line-height: 16px; } -.welcome-panel .welcome-panel-column ul, -.try-gutenberg-panel .try-gutenberg-panel-column ul { - margin: 0.8em 1em 1em 0; +.welcome-panel .welcome-panel-column ul { + margin: 0.8em 1em 1em 0; } -.welcome-panel .welcome-panel-column li, -.try-gutenberg-panel .try-gutenberg-panel-column li { +.welcome-panel .welcome-panel-column li { line-height: 16px; list-style-type: none; padding: 0 0 8px; @@ -1246,29 +1207,14 @@ a.rsswidget { } } -@media screen and (max-width: 1024px) { - .try-gutenberg-panel .try-gutenberg-panel-image-column { - display: none; - } - - .try-gutenberg-panel .try-gutenberg-panel-column { - width: calc( 49% - 20px ); - } -} - @media screen and (max-width: 870px) { .welcome-panel .welcome-panel-column, - .try-gutenberg-panel .try-gutenberg-panel-column, .welcome-panel .welcome-panel-column:first-child { display: block; float: none; width: 100%; } - .try-gutenberg-panel .try-gutenberg-panel-image-column { - display: none; - } - .welcome-panel .welcome-panel-column li { display: inline-block; margin-right: 13px; @@ -1277,6 +1223,7 @@ a.rsswidget { .welcome-panel .welcome-panel-column ul { margin: 0.4em 0 0; } + } @media screen and ( max-width: 782px ) { @@ -1319,8 +1266,7 @@ a.rsswidget { /* Smartphone */ @media screen and (max-width: 600px) { /* Keep the close icon from overlapping the Welcome text. */ - .welcome-panel .welcome-panel-close, - .try-gutenberg-panel .try-gutenberg-panel-close { + .welcome-panel .welcome-panel-close { overflow: hidden; text-indent: 40px; white-space: nowrap; @@ -1332,8 +1278,7 @@ a.rsswidget { } /* Make the close icon larger for tappability. */ - .welcome-panel .welcome-panel-close:before, - .try-gutenberg-panel .try-gutenberg-panel-close:before { + .welcome-panel .welcome-panel-close:before { font-size: 20px; top: 5px; left: -35px; diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index c523411efb..53f4b31d33 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1479,19 +1479,6 @@ function wp_ajax_update_welcome_panel() { wp_die( 1 ); } -/** - * Ajax handler for updating whether to display the Try Gutenberg panel. - * - * @since 4.9.0 - */ -function wp_ajax_update_try_gutenberg_panel() { - check_ajax_referer( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce' ); - - update_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', empty( $_POST['visible'] ) ? 0 : 1 ); - - wp_die( 1 ); -} - /** * Ajax handler for retrieving menu meta boxes. * diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 84cbd9164f..0146b56cbf 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -1020,10 +1020,7 @@ final class WP_Screen { update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked ); } else { $welcome_checked = get_user_meta( get_current_user_id(), 'show_welcome_panel', true ); - if ( '' === $welcome_checked ) { - $welcome_checked = '1'; - } - if ( '2' === $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) { + if ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) { $welcome_checked = false; } } @@ -1031,24 +1028,6 @@ final class WP_Screen { echo ''; echo _x( 'Welcome', 'Welcome panel' ) . "\n"; } - - if ( 'dashboard' === $this->id && has_action( 'try_gutenberg_panel' ) ) { - if ( isset( $_GET['try_gutenberg'] ) ) { - $try_gutenberg_checked = empty( $_GET['try_gutenberg'] ) ? 0 : 1; - update_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', $try_gutenberg_checked ); - } else { - $try_gutenberg_checked = get_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', true ); - if ( '' === $try_gutenberg_checked ) { - $try_gutenberg_checked = '1'; - } - if ( '2' === $try_gutenberg_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) { - $try_gutenberg_checked = false; - } - } - echo '\n"; - } ?> -
-
-
- <?php esc_attr_e( 'Gutenberg animated preview' ); ?> -
-

-
-

- -

- -
-
-

-
    -
  • codenamed Gutenberg.' ), - 'https://wordpress.org/gutenberg/' - ); - ?>
  • -
  • with testing, or contribute on the GitHub repository.' ), - __( 'https://make.wordpress.org/test/handbook/call-for-testing/gutenberg-testing/' ), - 'https://github.com/WordPress/gutenberg/' - ); - ?>
  • -
-
-
-
-

-user_email !== get_option( 'admin_email' ) ); - if ( $hide ) - $classes .= ' hidden'; ?> - -
- - - -
- user_email != get_option( 'admin_email' ) ); + $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) ); if ( $hide ) $classes .= ' hidden'; ?> diff --git a/src/wp-admin/js/dashboard.js b/src/wp-admin/js/dashboard.js index 8b6c4bbfa4..a6b56c37ef 100644 --- a/src/wp-admin/js/dashboard.js +++ b/src/wp-admin/js/dashboard.js @@ -31,48 +31,6 @@ jQuery(document).ready( function($) { updateWelcomePanel( this.checked ? 1 : 0 ); }); - var tryGutenbergPanel = $( '#try-gutenberg-panel' ), - tryGutenbergPanelHide = $('#wp_try_gutenberg_panel-hide'), - updateTryGutenbergPanel, installGutenbergSuccess; - - updateTryGutenbergPanel = function( visible ) { - $.post( ajaxurl, { - action: 'update-try-gutenberg-panel', - visible: visible, - trygutenbergpanelnonce: $( '#trygutenbergpanelnonce' ).val() - }); - }; - - installGutenbergSuccess = function( response ) { - response.activateUrl += '&from=try-gutenberg'; - wp.updates.installPluginSuccess( response ); - }; - - if ( tryGutenbergPanel.hasClass('hidden') && tryGutenbergPanelHide.prop('checked') ) { - tryGutenbergPanel.removeClass('hidden'); - } - - $('.try-gutenberg-panel-close, .try-gutenberg-panel-dismiss a', tryGutenbergPanel).click( function(e) { - e.preventDefault(); - tryGutenbergPanel.addClass('hidden'); - updateTryGutenbergPanel( 0 ); - $('#wp_try_gutenberg_panel-hide').prop('checked', false); - }); - - tryGutenbergPanelHide.click( function() { - tryGutenbergPanel.toggleClass('hidden', ! this.checked ); - updateTryGutenbergPanel( this.checked ? 1 : 0 ); - }); - - tryGutenbergPanel.on( 'click', '.install-now', function( e ) { - e.preventDefault(); - var args = { - slug: 'gutenberg', - success: installGutenbergSuccess - }; - wp.updates.installPlugin( args ); - } ); - // These widgets are sometimes populated via ajax ajaxWidgets = ['dashboard_primary']; diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index e9f64b29f1..cf63c17e2b 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -585,18 +585,10 @@ $message .removeClass( 'updating-message' ) - .addClass( 'updated-message installed' ) + .addClass( 'updated-message installed button-disabled' ) .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) .text( wp.updates.l10n.pluginInstalled ); - if ( $message.hasClass( 'button-primary' ) ) { - $message.addClass( 'button-primary-disabled' ); - } else if ( $message.hasClass( 'button-secondary' ) ) { - $message.addClass( 'button-secondary-disabled' ); - } else { - $message.addClass( 'button-disabled' ); - } - wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' ); $document.trigger( 'wp-plugin-install-success', response ); @@ -605,8 +597,7 @@ setTimeout( function() { // Transform the 'Install' button into an 'Activate' button. - $message.removeClass( 'install-now installed button-primary-disabled button-secondary-disabled button-disabled updated-message' ) - .addClass( 'activate-now button-primary' ) + $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' ) .attr( 'href', response.activateUrl ) .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) ) .text( wp.updates.l10n.activatePlugin ); diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index f22db39c33..b92a7964e6 100644 --- a/src/wp-admin/plugins.php +++ b/src/wp-admin/plugins.php @@ -65,8 +65,6 @@ if ( $action ) { 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 } else if ( isset($_GET['from']) && 'press-this' == $_GET['from'] ) { wp_redirect( self_admin_url( "press-this.php") ); - } else if ( isset($_GET['from']) && 'try-gutenberg' == $_GET['from'] ) { - wp_redirect( self_admin_url( "admin.php?page=gutenberg-demo") ); } else { wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above } diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index f615444ab0..9315d397ff 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -318,7 +318,6 @@ add_action( 'transition_post_status', '_transition_post_status', add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); -add_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); add_action( 'welcome_panel', 'wp_welcome_panel' ); // Cron tasks