Ticket #41316: 41316.diff
File 41316.diff, 9.0 KB (added by , 6 years ago) |
---|
-
src/wp-admin/css/common.css
764 764 765 765 /* @todo can we combine these into a class or use an existing dashicon one? */ 766 766 .welcome-panel .welcome-panel-close:before, 767 .try-gutenberg-panel .try-gutenberg-panel-close:before, 767 768 .tagchecklist .ntdelbutton .remove-tag-icon:before, 768 769 #bulk-titles div a:before, 769 770 .notice-dismiss:before { -
src/wp-admin/css/dashboard.css
98 98 } 99 99 100 100 /* Welcome Panel */ 101 .welcome-panel { 101 .welcome-panel, 102 .try-gutenberg-panel { 102 103 position: relative; 103 104 overflow: auto; 104 105 margin: 16px 0; … … 110 111 line-height: 2.1em; 111 112 } 112 113 113 .welcome-panel h2 { 114 .welcome-panel h2, 115 .try-gutenberg-panel h2 { 114 116 margin: 0; 115 117 font-size: 21px; 116 118 font-weight: 400; 117 119 line-height: 1.2; 118 120 } 119 121 120 .welcome-panel h3 { 122 .welcome-panel h3, 123 .try-gutenberg-panel h3 { 121 124 margin: 1.33em 0 0; 122 125 font-size: 16px; 123 126 } … … 126 129 font-size: 14px; 127 130 } 128 131 129 .welcome-panel p { 132 .welcome-panel p, 133 .try-gutenberg-panel p { 130 134 color: #72777c; 131 135 } 132 136 133 .welcome-panel a { 137 .welcome-panel a, 138 .try-gutenberg-panel a { 134 139 text-decoration: none; 135 140 } 136 141 137 .welcome-panel .about-description { 142 .welcome-panel .about-description, 143 .try-gutenberg-panel .about-description { 138 144 font-size: 16px; 139 145 margin: 0; 140 146 } 141 147 142 .welcome-panel .welcome-panel-close { 148 .welcome-panel .welcome-panel-close, 149 .try-gutenberg-panel .try-gutenberg-panel-close { 143 150 position: absolute; 144 151 top: 10px; 145 152 right: 10px; … … 149 156 text-decoration: none; 150 157 } 151 158 152 .welcome-panel .welcome-panel-close:before { 159 .welcome-panel .welcome-panel-close:before, 160 .try-gutenberg-panel .try-gutenberg-panel-close:before { 153 161 position: absolute; 154 162 top: 8px; 155 163 left: 0; … … 164 172 white-space: normal; 165 173 } 166 174 167 .welcome-panel-content { 175 .welcome-panel-content, 176 .try-gutenberg-panel-content { 168 177 margin-left: 13px; 169 178 max-width: 1500px; 170 179 } 171 180 181 .try-gutenberg-panel img { 182 width: 400px; 183 float: left; 184 padding: 0 20px 20px 0; 185 } 186 187 .try-gutenberg-panel .install-now.updating-message:before, 188 .try-gutenberg-panel .install-now.updated-message:before { 189 margin-top: 11px; 190 } 191 172 192 .welcome-panel .welcome-panel-column-container { 173 193 clear: both; 174 194 position: relative; -
src/wp-admin/css/list-tables.css
1296 1296 white-space:nowrap; 1297 1297 } 1298 1298 1299 #wpbody-content .plugins .plugin-title.has-icon img { 1300 float: left; 1301 margin: 0 9px 0 0; 1302 width: 64px; 1303 height: 64px; 1304 } 1305 1306 #wpbody-content .plugins .plugin-title.has-icon strong { 1307 margin-right: 64px; 1308 } 1309 1299 1310 .updates-table-screenshot { 1300 1311 float:left; 1301 1312 padding: 0 10px 5px 0; -
src/wp-admin/includes/dashboard.php
1560 1560 * 1561 1561 * @since 3.3.0 1562 1562 */ 1563 function wp_welcome_panel() {1563 function wp_welcome_panel() { 1564 1564 ?> 1565 1565 <div class="welcome-panel-content"> 1566 1566 <h2><?php _e( 'Welcome to WordPress!' ); ?></h2> … … 1618 1618 </div> 1619 1619 <?php 1620 1620 } 1621 1622 /** 1623 * Displays a Try Gutenberg Panel, to introduce people to Gutenberg 1624 * 1625 * @since 4.9.0 1626 */ 1627 function wp_try_gutenberg_panel() { 1628 $plugins = get_plugins(); 1629 $action = $url = $classes = ''; 1630 1631 if ( current_user_can( 'install_plugins' ) && empty( $plugins['gutenberg/gutenberg.php'] ) ) { 1632 $action = __( 'Download Gutenberg today' ); 1633 $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' ); 1634 $classes = ' install-now'; 1635 } else if ( current_user_can( 'install_plugins' ) && is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) { 1636 $action = __( 'Activate Gutenberg today' ); 1637 $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php' ), 'activate-plugin_gutenberg/gutenberg.php' ); 1638 } else if ( current_user_can( 'edit_posts' ) ) { 1639 $action = __( 'Try Gutenberg today' ); 1640 $url = admin_url( 'admin.php?page=gutenberg' ); 1641 } 1642 1643 ?> 1644 <div id="plugin-filter" class="try-gutenberg-panel-content plugin-card-gutenberg"> 1645 <img src="https://wordpress.org/gutenberg/files/2017/08/colimage-Gutenberg-1.gif" /> 1646 <h2><?php _e( 'Try Gutenberg' ); ?></h2> 1647 <p class="about-description"><?php _e( 'The new editing experience for WordPress' ); ?></p> 1648 <?php if ( $action ) { ?> 1649 <p><a class="button button-primary button-hero<?php echo $classes; ?>" data-slug="gutenberg" href="<?php echo esc_url( $url ); ?>"><?php echo $action; ?></a></p> 1650 <?php } ?> 1651 <h3><?php _e( 'Want to get involved?' ); ?></h3> 1652 <p><?php printf( __( 'Learn more about Gutenberg <a href="%s">right here</a>.' ), 'https://wordpress.org/gutenberg/' ); ?></p> 1653 <p><?php printf( __( 'Help <a href="%1$s">with testing</a>, or contribute on the <a href="%2$s">GitHub repository</a>.' ), '', 'https://github.com/WordPress/gutenberg/' ); ?></p> 1654 </div> 1655 <?php 1656 } -
src/wp-admin/index.php
105 105 <div class="wrap"> 106 106 <h1><?php echo esc_html( $title ); ?></h1> 107 107 108 <?php if ( has_action( 'try_gutenberg_panel' ) ) : 109 $classes = 'try-gutenberg-panel'; 110 111 $option = get_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', true ); 112 echo $option; 113 // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner 114 $hide = 0 === $option || ( 2 === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ); 115 if ( $hide ) 116 $classes .= ' hidden'; ?> 117 118 <div id="gutenpanel" class="<?php echo esc_attr( $classes ); ?>"> 119 <?php wp_nonce_field( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce', false ); ?> 120 <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> 121 <?php 122 /** 123 * Add content to the Try Gutenberg panel on the admin dashboard. 124 * 125 * To remove the Try Gutenberg panel, use remove_action(): 126 * 127 * remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); 128 * 129 * @since 4.9.0 130 */ 131 do_action( 'try_gutenberg_panel' ); 132 ?> 133 </div> 134 <?php endif; ?> 108 135 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) : 109 136 $classes = 'welcome-panel'; 110 137 -
src/wp-admin/js/updates.js
585 585 586 586 $message 587 587 .removeClass( 'updating-message' ) 588 .addClass( 'updated-message installed button-disabled' )588 .addClass( 'updated-message installed' ) 589 589 .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) 590 590 .text( wp.updates.l10n.pluginInstalled ); 591 591 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 592 600 wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' ); 593 601 594 602 $document.trigger( 'wp-plugin-install-success', response ); … … 597 605 setTimeout( function() { 598 606 599 607 // Transform the 'Install' button into an 'Activate' button. 600 $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' ) 608 $message.removeClass( 'install-now installed button-primary-disabled button-secondary-disabled button-disabled updated-message' ) 609 .addClass( 'activate-now button-primary' ) 601 610 .attr( 'href', response.activateUrl ) 602 611 .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) ) 603 612 .text( wp.updates.l10n.activatePlugin ); -
src/wp-includes/default-filters.php
322 322 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 323 323 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); 324 324 add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); 325 add_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); 325 326 add_action( 'welcome_panel', 'wp_welcome_panel' ); 326 327 327 328 // Navigation menu actions