Ticket #45063: 45063.patch
File 45063.patch, 25.2 KB (added by , 7 years ago) |
---|
-
wordpress/wp-admin/about.php
diff -Naur wordpress/wp-admin/about.php wordpress/wp-admin/about.php
314 314 </div> 315 315 </div> 316 316 317 <div class="inline-svg">318 <picture>319 <source media="(max-width: 500px)" srcset="<?php echo 'https://s.w.org/images/core/4.9/gutenberg-mobile.svg'; ?>">320 <img src="https://s.w.org/images/core/4.9/gutenberg.svg" alt="">321 </picture>322 </div>323 324 <div class="feature-section">325 <h2>326 <?php327 printf(328 /* translators: %s: handshake emoji */329 __( 'Lend a Hand with Gutenberg %s' ),330 '🤝'331 );332 ?>333 </h2>334 <p><?php printf(335 __( 'WordPress is working on a new way to create and control your content and we’d love to have your help. Interested in being an <a href="%s">early tester</a> or getting involved with the Gutenberg project? <a href="%s">Contribute on GitHub</a>.' ),336 __( 'https://wordpress.org/plugins/gutenberg/' ),337 'https://github.com/WordPress/gutenberg' ); ?></p>338 </div>339 340 317 <hr /> 341 318 342 319 <div class="changelog"> -
wordpress/wp-admin/admin-ajax.php
diff -Naur wordpress/wp-admin/admin-ajax.php wordpress/wp-admin/admin-ajax.php
67 67 'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file', 68 68 'wp-privacy-export-personal-data', 69 69 'wp-privacy-erase-personal-data', 70 'update-try-gutenberg-panel',71 70 ); 72 71 73 72 // Deprecated -
wordpress/wp-admin/css/common.css
diff -Naur wordpress/wp-admin/css/common.css wordpress/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,768 767 .tagchecklist .ntdelbutton .remove-tag-icon:before, 769 768 #bulk-titles div a:before, 770 769 .notice-dismiss:before { -
wordpress/wp-admin/css/common-rtl.css
diff -Naur wordpress/wp-admin/css/common-rtl.css wordpress/wp-admin/css/common-rtl.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,768 767 .tagchecklist .ntdelbutton .remove-tag-icon:before, 769 768 #bulk-titles div a:before, 770 769 .notice-dismiss:before { -
wordpress/wp-admin/css/dashboard.css
diff -Naur wordpress/wp-admin/css/dashboard.css wordpress/wp-admin/css/dashboard.css
98 98 } 99 99 100 100 /* Welcome Panel */ 101 .welcome-panel, 102 .try-gutenberg-panel { 101 .welcome-panel { 103 102 position: relative; 104 103 overflow: auto; 105 104 margin: 16px 0; … … 111 110 line-height: 2.1em; 112 111 } 113 112 114 .welcome-panel h2, 115 .try-gutenberg-panel h2 { 113 .welcome-panel h2 { 116 114 margin: 0; 117 115 font-size: 21px; 118 116 font-weight: 400; … … 124 122 font-size: 16px; 125 123 } 126 124 127 .try-gutenberg-panel h3 { 128 margin: 17px 0 0; 129 font-size: 16px; 130 line-height: 1.4; 131 } 132 133 .welcome-panel li, 134 .try-gutenberg-panel li { 125 .welcome-panel li { 135 126 font-size: 14px; 136 127 } 137 128 138 .welcome-panel p, 139 .try-gutenberg-panel p { 129 .welcome-panel p { 140 130 color: #72777c; 141 131 } 142 132 143 .welcome-panel a, 144 .try-gutenberg-action a { 133 .welcome-panel a { 145 134 text-decoration: none; 146 135 } 147 136 148 .welcome-panel .about-description, 149 .try-gutenberg-panel .about-description { 137 .welcome-panel .about-description { 150 138 font-size: 16px; 151 139 margin: 0; 152 140 } 153 141 154 .try-gutenberg-panel-content hr { 155 margin: 20px -23px 0 -23px; 156 border-top: 1px solid #f3f4f5; 157 border-bottom: none; 158 } 159 160 .welcome-panel .welcome-panel-close, 161 .try-gutenberg-panel .try-gutenberg-panel-close { 142 .welcome-panel .welcome-panel-close { 162 143 position: absolute; 163 144 z-index: 10; 164 145 top: 10px; … … 169 150 text-decoration: none; 170 151 } 171 152 172 .welcome-panel .welcome-panel-close:before, 173 .try-gutenberg-panel .try-gutenberg-panel-close:before { 153 .welcome-panel .welcome-panel-close:before { 174 154 position: absolute; 175 155 top: 8px; 176 156 left: 0; … … 185 165 white-space: normal; 186 166 } 187 167 188 .welcome-panel-content, 189 .try-gutenberg-panel-content { 168 .welcome-panel-content { 190 169 margin: 0 13px; 191 170 max-width: 1500px; 192 171 } 193 172 194 .try-gutenberg-panel img {195 margin-top: 23px;196 width: calc( 100% - 40px );197 border: 1px solid #f3f4f5;198 }199 200 .try-gutenberg-panel .install-now.updating-message:before,201 .try-gutenberg-panel .install-now.updated-message:before {202 margin-top: 11px;203 }204 205 173 .welcome-panel .welcome-panel-column-container { 206 174 clear: both; 207 175 position: relative; … … 213 181 float: left; 214 182 } 215 183 216 .try-gutenberg-panel .try-gutenberg-panel-column > * {217 padding-right: 40px;218 }219 220 184 .ie8 .welcome-panel .welcome-panel-column { 221 185 min-width: 230px; 222 186 } … … 225 189 width: 36%; 226 190 } 227 191 228 .try-gutenberg-panel .try-gutenberg-panel-column-container {229 display: -ms-grid;230 display: grid;231 -ms-grid-columns: 36% 32% 32%;232 grid-template-columns: 36% 32% 32%;233 margin-bottom: 13px;234 }235 236 .try-gutenberg-panel .try-gutenberg-panel-column:not(.try-gutenberg-panel-image-column) {237 display: -ms-grid;238 display: grid;239 -ms-grid-rows: auto 100px;240 grid-template-rows: auto 100px;241 }242 243 192 .welcome-panel-column p.hide-if-no-customize { 244 193 margin-top: 10px; 245 194 } 246 195 247 .welcome-panel-column p, 248 .try-gutenberg-panel-column p { 196 .welcome-panel-column p { 249 197 margin-top: 7px; 250 198 color: #444; 251 199 } … … 1260 1208 } 1261 1209 } 1262 1210 1263 @media screen and (max-width: 1024px) {1264 .try-gutenberg-panel .try-gutenberg-panel-column-container {1265 -ms-grid-columns: 50% 50%;1266 grid-template-columns: 50% 50%;1267 }1268 1269 .try-gutenberg-panel .try-gutenberg-panel-image-column {1270 display: none;1271 }1272 }1273 1274 1211 @media screen and (max-width: 870px) { 1275 1212 .welcome-panel .welcome-panel-column, 1276 1213 .welcome-panel .welcome-panel-column:first-child { … … 1279 1216 width: 100%; 1280 1217 } 1281 1218 1282 .try-gutenberg-panel .try-gutenberg-panel-column-container {1283 -ms-grid-columns: 100%;1284 grid-template-columns: 100%;1285 }1286 1287 1219 .welcome-panel .welcome-panel-column li { 1288 1220 display: inline-block; 1289 1221 margin-right: 13px; … … 1334 1266 /* Smartphone */ 1335 1267 @media screen and (max-width: 600px) { 1336 1268 /* Keep the close icon from overlapping the Welcome text. */ 1337 .welcome-panel .welcome-panel-close, 1338 .try-gutenberg-panel .try-gutenberg-panel-close { 1269 .welcome-panel .welcome-panel-close { 1339 1270 overflow: hidden; 1340 1271 text-indent: 40px; 1341 1272 white-space: nowrap; … … 1347 1278 } 1348 1279 1349 1280 /* Make the close icon larger for tappability. */ 1350 .welcome-panel .welcome-panel-close:before, 1351 .try-gutenberg-panel .try-gutenberg-panel-close:before { 1281 .welcome-panel .welcome-panel-close:before { 1352 1282 font-size: 20px; 1353 1283 top: 5px; 1354 1284 left: -35px; -
wordpress/wp-admin/css/dashboard-rtl.css
diff -Naur wordpress/wp-admin/css/dashboard-rtl.css wordpress/wp-admin/css/dashboard-rtl.css
98 98 } 99 99 100 100 /* Welcome Panel */ 101 .welcome-panel, 102 .try-gutenberg-panel { 101 .welcome-panel { 103 102 position: relative; 104 103 overflow: auto; 105 104 margin: 16px 0; … … 111 110 line-height: 2.1em; 112 111 } 113 112 114 .welcome-panel h2, 115 .try-gutenberg-panel h2 { 113 .welcome-panel h2 { 116 114 margin: 0; 117 115 font-size: 21px; 118 116 font-weight: 400; … … 124 122 font-size: 16px; 125 123 } 126 124 127 .try-gutenberg-panel h3 { 128 margin: 17px 0 0; 129 font-size: 16px; 130 line-height: 1.4; 131 } 132 133 .welcome-panel li, 134 .try-gutenberg-panel li { 125 .welcome-panel li { 135 126 font-size: 14px; 136 127 } 137 128 138 .welcome-panel p, 139 .try-gutenberg-panel p { 129 .welcome-panel p { 140 130 color: #72777c; 141 131 } 142 132 143 .welcome-panel a, 144 .try-gutenberg-action a { 133 .welcome-panel a { 145 134 text-decoration: none; 146 135 } 147 136 148 .welcome-panel .about-description, 149 .try-gutenberg-panel .about-description { 137 .welcome-panel .about-description { 150 138 font-size: 16px; 151 139 margin: 0; 152 140 } 153 141 154 .try-gutenberg-panel-content hr { 155 margin: 20px -23px 0 -23px; 156 border-top: 1px solid #f3f4f5; 157 border-bottom: none; 158 } 159 160 .welcome-panel .welcome-panel-close, 161 .try-gutenberg-panel .try-gutenberg-panel-close { 142 .welcome-panel .welcome-panel-close { 162 143 position: absolute; 163 144 z-index: 10; 164 145 top: 10px; … … 169 150 text-decoration: none; 170 151 } 171 152 172 .welcome-panel .welcome-panel-close:before, 173 .try-gutenberg-panel .try-gutenberg-panel-close:before { 153 .welcome-panel .welcome-panel-close:before { 174 154 position: absolute; 175 155 top: 8px; 176 156 right: 0; … … 185 165 white-space: normal; 186 166 } 187 167 188 .welcome-panel-content, 189 .try-gutenberg-panel-content { 168 .welcome-panel-content { 190 169 margin: 0 13px; 191 170 max-width: 1500px; 192 171 } 193 172 194 .try-gutenberg-panel img {195 margin-top: 23px;196 width: calc( 100% - 40px );197 border: 1px solid #f3f4f5;198 }199 200 .try-gutenberg-panel .install-now.updating-message:before,201 .try-gutenberg-panel .install-now.updated-message:before {202 margin-top: 11px;203 }204 205 173 .welcome-panel .welcome-panel-column-container { 206 174 clear: both; 207 175 position: relative; … … 213 181 float: right; 214 182 } 215 183 216 .try-gutenberg-panel .try-gutenberg-panel-column > * {217 padding-left: 40px;218 }219 220 184 .ie8 .welcome-panel .welcome-panel-column { 221 185 min-width: 230px; 222 186 } … … 225 189 width: 36%; 226 190 } 227 191 228 .try-gutenberg-panel .try-gutenberg-panel-column-container {229 display: -ms-grid;230 display: grid;231 -ms-grid-columns: 36% 32% 32%;232 grid-template-columns: 36% 32% 32%;233 margin-bottom: 13px;234 }235 236 .try-gutenberg-panel .try-gutenberg-panel-column:not(.try-gutenberg-panel-image-column) {237 display: -ms-grid;238 display: grid;239 -ms-grid-rows: auto 100px;240 grid-template-rows: auto 100px;241 }242 243 192 .welcome-panel-column p.hide-if-no-customize { 244 193 margin-top: 10px; 245 194 } 246 195 247 .welcome-panel-column p, 248 .try-gutenberg-panel-column p { 196 .welcome-panel-column p { 249 197 margin-top: 7px; 250 198 color: #444; 251 199 } … … 1260 1208 } 1261 1209 } 1262 1210 1263 @media screen and (max-width: 1024px) {1264 .try-gutenberg-panel .try-gutenberg-panel-column-container {1265 -ms-grid-columns: 50% 50%;1266 grid-template-columns: 50% 50%;1267 }1268 1269 .try-gutenberg-panel .try-gutenberg-panel-image-column {1270 display: none;1271 }1272 }1273 1274 1211 @media screen and (max-width: 870px) { 1275 1212 .welcome-panel .welcome-panel-column, 1276 1213 .welcome-panel .welcome-panel-column:first-child { … … 1279 1216 width: 100%; 1280 1217 } 1281 1218 1282 .try-gutenberg-panel .try-gutenberg-panel-column-container {1283 -ms-grid-columns: 100%;1284 grid-template-columns: 100%;1285 }1286 1287 1219 .welcome-panel .welcome-panel-column li { 1288 1220 display: inline-block; 1289 1221 margin-left: 13px; … … 1334 1266 /* Smartphone */ 1335 1267 @media screen and (max-width: 600px) { 1336 1268 /* Keep the close icon from overlapping the Welcome text. */ 1337 .welcome-panel .welcome-panel-close, 1338 .try-gutenberg-panel .try-gutenberg-panel-close { 1269 .welcome-panel .welcome-panel-close { 1339 1270 overflow: hidden; 1340 1271 text-indent: 40px; 1341 1272 white-space: nowrap; … … 1347 1278 } 1348 1279 1349 1280 /* Make the close icon larger for tappability. */ 1350 .welcome-panel .welcome-panel-close:before, 1351 .try-gutenberg-panel .try-gutenberg-panel-close:before { 1281 .welcome-panel .welcome-panel-close:before { 1352 1282 font-size: 20px; 1353 1283 top: 5px; 1354 1284 right: -35px; -
wordpress/wp-admin/includes/ajax-actions.php
diff -Naur wordpress/wp-admin/includes/ajax-actions.php wordpress/wp-admin/includes/ajax-actions.php
1485 1485 } 1486 1486 1487 1487 /** 1488 * Ajax handler for updating whether to display the Try Gutenberg panel.1489 *1490 * @since 4.9.81491 */1492 function 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 1500 /**1501 1488 * Ajax handler for retrieving menu meta boxes. 1502 1489 * 1503 1490 * @since 3.1.0 -
wordpress/wp-admin/includes/class-wp-screen.php
diff -Naur wordpress/wp-admin/includes/class-wp-screen.php wordpress/wp-admin/includes/class-wp-screen.php
1032 1032 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 1033 1033 } 1034 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 }1052 1035 ?> 1053 1036 </fieldset> 1054 1037 <?php -
wordpress/wp-admin/includes/dashboard.php
diff -Naur wordpress/wp-admin/includes/dashboard.php wordpress/wp-admin/includes/dashboard.php
24 24 25 25 /* Register Widgets and Controls */ 26 26 27 // Try Gutenberg28 29 // If Gutenberg isn't activated, only show the panel to users who can install and activate it.30 $plugins = get_plugins();31 if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'install_plugins' ) ) {32 remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );33 }34 // If Gutenberg is activated, only show it to users who can use it.35 if ( is_plugin_active( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'edit_posts' ) ) {36 remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );37 }38 39 27 $response = wp_check_browser_version(); 40 28 41 29 if ( $response && $response['upgrade'] ) { … … 1631 1619 </div> 1632 1620 <?php 1633 1621 } 1634 1635 /**1636 * Displays a Try Gutenberg Panel, to introduce people to Gutenberg1637 *1638 * @since 4.9.81639 */1640 function wp_try_gutenberg_panel() {1641 $plugins = get_plugins();1642 $action = $url = $classes = '';1643 $classic_action = $classic_url = $classic_classes = '';1644 1645 if ( current_user_can( 'install_plugins' ) ) {1646 if ( empty( $plugins['gutenberg/gutenberg.php'] ) ) {1647 if ( get_filesystem_method( array(), WP_PLUGIN_DIR ) === 'direct' ) {1648 $action = __( 'Install Gutenberg' );1649 $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' );1650 $classes = ' install-now';1651 }1652 } else if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) {1653 $action = __( 'Activate Gutenberg' );1654 $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php&from=try-gutenberg' ), 'activate-plugin_gutenberg/gutenberg.php' );1655 $classes = ' activate-now';1656 }1657 1658 if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {1659 if ( get_filesystem_method( array(), WP_PLUGIN_DIR ) === 'direct' ) {1660 $classic_action = __( 'Install the Classic Editor' );1661 $classic_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' );1662 $classic_classes = ' install-now';1663 }1664 } else if ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {1665 $classic_action = __( 'Activate the Classic Editor' );1666 $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' );1667 $classic_classes = ' activate-now';1668 } else {1669 $classic_action = __( 'The Classic Editor is activated' );1670 $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' );;1671 $classic_classes = ' button-disabled install-now updated-message';1672 }1673 }1674 1675 if ( current_user_can( 'edit_posts' ) && is_plugin_active( 'gutenberg/gutenberg.php' ) ) {1676 $action = __( 'Try Gutenberg' );1677 $url = admin_url( 'admin.php?page=gutenberg' );1678 }1679 1680 ?>1681 <div class="try-gutenberg-panel-content">1682 <h2><?php _e( 'A new, modern publishing experience is coming soon.' ); ?></h2>1683 1684 <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>1685 1686 <hr />1687 1688 <div class="try-gutenberg-panel-column-container">1689 <div class="try-gutenberg-panel-column try-gutenberg-panel-image-column">1690 <picture>1691 <source srcset="about:blank" media="(max-width: 1024px)">1692 <img src="https://s.w.org/images/core/gutenberg-screenshot.png?<?php echo date( 'Ymd' ); ?>" alt="<?php esc_attr_e( 'Screenshot from the Gutenberg interface' ); ?>" />1693 </picture>1694 </div>1695 <div class="try-gutenberg-panel-column plugin-card-gutenberg">1696 1697 <div>1698 <h3><?php _e( 'Test the new editor today.' ); ?></h3>1699 1700 <p>1701 <?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." ); ?>1702 <?php1703 printf(1704 /* translators: 1: Gutenberg call for testing handbook link, 2: Gutenberg GitHub repository issues link, 3: Gutenberg GitHub repository CONTRIBUTING.md link */1705 __( '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>.' ),1706 'https://make.wordpress.org/test/handbook/call-for-testing/gutenberg-testing/',1707 'https://github.com/WordPress/gutenberg/issues',1708 'https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md'1709 );1710 ?>1711 </p>1712 </div>1713 1714 <div class="try-gutenberg-action">1715 <?php if ( $action ) { ?>1716 <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>1717 <?php } ?>1718 1719 <p>1720 <?php1721 $learnmore = sprintf(1722 /* translators: Link to https://wordpress.org/gutenberg/ */1723 __( '<a href="%s">Learn more about Gutenberg</a>' ),1724 __( 'https://wordpress.org/gutenberg/' )1725 );1726 1727 /**1728 * Filters the "Learn more" link in the Try Gutenberg panel.1729 *1730 * It allows hosts or site owners to change the link, to provide extra1731 * information about Gutenberg, specific to their service.1732 *1733 * WARNING: This filter will only exist in the 4.9.x series, it will not be1734 * added to WordPress 5.0 and later.1735 *1736 * @since 4.9.81737 */1738 echo apply_filters( 'try_gutenberg_learn_more_link', $learnmore );1739 ?>1740 </p>1741 </div>1742 </div>1743 1744 <div class="try-gutenberg-panel-column plugin-card-classic-editor">1745 1746 <div>1747 <h3><?php _e( 'Not quite ready?' ); ?></h3>1748 1749 <p>1750 <?php _e( 'The new editor will be enabled by default in the next major release of WordPress. If you’re not sure how compatible your current themes and plugins are, we’ve got you covered.' ); ?>1751 <?php1752 printf(1753 /* translators: Link to the Classic Editor plugin page */1754 __( 'Install the <a href="%s">Classic Editor plugin</a> to keep using the current editor until you’re ready to make the switch.' ),1755 __( 'https://wordpress.org/plugins/classic-editor' )1756 );1757 ?>1758 </p>1759 </div>1760 1761 <?php if ( $classic_action ) { ?>1762 <div class="try-gutenberg-action">1763 <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>1764 </div>1765 <?php } ?>1766 </div>1767 </div>1768 </div>1769 <?php1770 } -
wordpress/wp-admin/index.php
diff -Naur wordpress/wp-admin/index.php wordpress/wp-admin/index.php
103 103 <div class="wrap"> 104 104 <h1><?php echo esc_html( $title ); ?></h1> 105 105 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 owner111 $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 <?php119 /**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.8127 */128 do_action( 'try_gutenberg_panel' );129 ?>130 </div>131 <?php endif; ?>132 106 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) : 133 107 $classes = 'welcome-panel'; 134 108 -
wordpress/wp-admin/js/dashboard.js
diff -Naur wordpress/wp-admin/js/dashboard.js wordpress/wp-admin/js/dashboard.js
31 31 updateWelcomePanel( this.checked ? 1 : 0 ); 32 32 }); 33 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 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: installGutenbergSuccess73 };74 wp.updates.installPlugin( args );75 } );76 77 34 // These widgets are sometimes populated via ajax 78 35 ajaxWidgets = ['dashboard_primary']; 79 36 -
wordpress/wp-admin/plugins.php
diff -Naur wordpress/wp-admin/plugins.php wordpress/wp-admin/plugins.php
65 65 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 66 66 } else if ( isset($_GET['from']) && 'press-this' == $_GET['from'] ) { 67 67 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 }74 68 } else { 75 69 wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above 76 70 } -
wordpress/wp-includes/default-filters.php
diff -Naur wordpress/wp-includes/default-filters.php wordpress/wp-includes/default-filters.php
318 318 add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); 319 319 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); 320 320 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 321 add_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );322 321 add_action( 'welcome_panel', 'wp_welcome_panel' ); 323 322 324 323 // Privacy