Commit 309b03ba authored by lucha's avatar lucha
Browse files

Wordpress 4.9.8

parent 3f5992e3
......@@ -11,7 +11,8 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
wp_enqueue_script( 'underscore' );
$title = __( 'About' );
/* translators: Page title of the About WordPress page in the admin. */
$title = _x( 'About', 'page title' );
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
......@@ -35,7 +36,27 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
46
),
'4.9.8',
number_format_i18n( 46 )
);
printf(
/* translators: %s: Codex URL */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
'https://codex.wordpress.org/Version_4.9.8'
);
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
......
......@@ -67,6 +67,7 @@ $core_actions_post = array(
'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file',
'wp-privacy-export-personal-data',
'wp-privacy-erase-personal-data',
'update-try-gutenberg-panel',
);
// Deprecated
......
......@@ -764,6 +764,7 @@ 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 {
......
This diff is collapsed.
......@@ -764,6 +764,7 @@ 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 {
......
This diff is collapsed.
......@@ -98,7 +98,8 @@
}
/* Welcome Panel */
.welcome-panel {
.welcome-panel,
.try-gutenberg-panel {
position: relative;
overflow: auto;
margin: 16px 0;
......@@ -110,7 +111,8 @@
line-height: 2.1em;
}
.welcome-panel h2 {
.welcome-panel h2,
.try-gutenberg-panel h2 {
margin: 0;
font-size: 21px;
font-weight: 400;
......@@ -122,25 +124,43 @@
font-size: 16px;
}
.welcome-panel li {
.try-gutenberg-panel h3 {
margin: 17px 0 0;
font-size: 16px;
line-height: 1.4;
}
.welcome-panel li,
.try-gutenberg-panel li {
font-size: 14px;
}
.welcome-panel p {
.welcome-panel p,
.try-gutenberg-panel p {
color: #72777c;
}
.welcome-panel a {
.welcome-panel a,
.try-gutenberg-action a {
text-decoration: none;
}
.welcome-panel .about-description {
.welcome-panel .about-description,
.try-gutenberg-panel .about-description {
font-size: 16px;
margin: 0;
}
.welcome-panel .welcome-panel-close {
.try-gutenberg-panel-content hr {
margin: 20px -23px 0 -23px;
border-top: 1px solid #f3f4f5;
border-bottom: none;
}
.welcome-panel .welcome-panel-close,
.try-gutenberg-panel .try-gutenberg-panel-close {
position: absolute;
z-index: 10;
top: 10px;
left: 10px;
padding: 10px 21px 10px 15px;
......@@ -149,7 +169,8 @@
text-decoration: none;
}
.welcome-panel .welcome-panel-close:before {
.welcome-panel .welcome-panel-close:before,
.try-gutenberg-panel .try-gutenberg-panel-close:before {
position: absolute;
top: 8px;
right: 0;
......@@ -164,11 +185,23 @@
white-space: normal;
}
.welcome-panel-content {
margin-right: 13px;
.welcome-panel-content,
.try-gutenberg-panel-content {
margin: 0 13px;
max-width: 1500px;
}
.try-gutenberg-panel img {
margin-top: 23px;
width: calc( 100% - 40px );
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 {
clear: both;
position: relative;
......@@ -180,6 +213,10 @@
float: right;
}
.try-gutenberg-panel .try-gutenberg-panel-column > * {
padding-left: 40px;
}
.ie8 .welcome-panel .welcome-panel-column {
min-width: 230px;
}
......@@ -188,11 +225,27 @@
width: 36%;
}
.try-gutenberg-panel .try-gutenberg-panel-column-container {
display: -ms-grid;
display: grid;
-ms-grid-columns: 36% 32% 32%;
grid-template-columns: 36% 32% 32%;
margin-bottom: 13px;
}
.try-gutenberg-panel .try-gutenberg-panel-column:not(.try-gutenberg-panel-image-column) {
display: -ms-grid;
display: grid;
-ms-grid-rows: auto 100px;
grid-template-rows: auto 100px;
}
.welcome-panel-column p.hide-if-no-customize {
margin-top: 10px;
}
.welcome-panel-column p {
.welcome-panel-column p,
.try-gutenberg-panel-column p {
margin-top: 7px;
color: #444;
}
......@@ -202,7 +255,7 @@
}
.welcome-panel .welcome-panel-column ul {
margin: 0.8em 0 1em 1em;
margin: 0.8em 0 1em 1em;
}
.welcome-panel .welcome-panel-column li {
......@@ -1207,6 +1260,17 @@ a.rsswidget {
}
}
@media screen and (max-width: 1024px) {
.try-gutenberg-panel .try-gutenberg-panel-column-container {
-ms-grid-columns: 50% 50%;
grid-template-columns: 50% 50%;
}
.try-gutenberg-panel .try-gutenberg-panel-image-column {
display: none;
}
}
@media screen and (max-width: 870px) {
.welcome-panel .welcome-panel-column,
.welcome-panel .welcome-panel-column:first-child {
......@@ -1215,6 +1279,11 @@ a.rsswidget {
width: 100%;
}
.try-gutenberg-panel .try-gutenberg-panel-column-container {
-ms-grid-columns: 100%;
grid-template-columns: 100%;
}
.welcome-panel .welcome-panel-column li {
display: inline-block;
margin-left: 13px;
......@@ -1223,7 +1292,6 @@ a.rsswidget {
.welcome-panel .welcome-panel-column ul {
margin: 0.4em 0 0;
}
}
@media screen and ( max-width: 782px ) {
......@@ -1266,7 +1334,8 @@ a.rsswidget {
/* Smartphone */
@media screen and (max-width: 600px) {
/* Keep the close icon from overlapping the Welcome text. */
.welcome-panel .welcome-panel-close {
.welcome-panel .welcome-panel-close,
.try-gutenberg-panel .try-gutenberg-panel-close {
overflow: hidden;
text-indent: 40px;
white-space: nowrap;
......@@ -1278,7 +1347,8 @@ a.rsswidget {
}
/* Make the close icon larger for tappability. */
.welcome-panel .welcome-panel-close:before {
.welcome-panel .welcome-panel-close:before,
.try-gutenberg-panel .try-gutenberg-panel-close:before {
font-size: 20px;
top: 5px;
right: -35px;
......
This diff is collapsed.
......@@ -98,7 +98,8 @@
}
/* Welcome Panel */
.welcome-panel {
.welcome-panel,
.try-gutenberg-panel {
position: relative;
overflow: auto;
margin: 16px 0;
......@@ -110,7 +111,8 @@
line-height: 2.1em;
}
.welcome-panel h2 {
.welcome-panel h2,
.try-gutenberg-panel h2 {
margin: 0;
font-size: 21px;
font-weight: 400;
......@@ -122,25 +124,43 @@
font-size: 16px;
}
.welcome-panel li {
.try-gutenberg-panel h3 {
margin: 17px 0 0;
font-size: 16px;
line-height: 1.4;
}
.welcome-panel li,
.try-gutenberg-panel li {
font-size: 14px;
}
.welcome-panel p {
.welcome-panel p,
.try-gutenberg-panel p {
color: #72777c;
}
.welcome-panel a {
.welcome-panel a,
.try-gutenberg-action a {
text-decoration: none;
}
.welcome-panel .about-description {
.welcome-panel .about-description,
.try-gutenberg-panel .about-description {
font-size: 16px;
margin: 0;
}
.welcome-panel .welcome-panel-close {
.try-gutenberg-panel-content hr {
margin: 20px -23px 0 -23px;
border-top: 1px solid #f3f4f5;
border-bottom: none;
}
.welcome-panel .welcome-panel-close,
.try-gutenberg-panel .try-gutenberg-panel-close {
position: absolute;
z-index: 10;
top: 10px;
right: 10px;
padding: 10px 15px 10px 21px;
......@@ -149,7 +169,8 @@
text-decoration: none;
}
.welcome-panel .welcome-panel-close:before {
.welcome-panel .welcome-panel-close:before,
.try-gutenberg-panel .try-gutenberg-panel-close:before {
position: absolute;
top: 8px;
left: 0;
......@@ -164,11 +185,23 @@
white-space: normal;
}
.welcome-panel-content {
margin-left: 13px;
.welcome-panel-content,
.try-gutenberg-panel-content {
margin: 0 13px;
max-width: 1500px;
}
.try-gutenberg-panel img {
margin-top: 23px;
width: calc( 100% - 40px );
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 {
clear: both;
position: relative;
......@@ -180,6 +213,10 @@
float: left;
}
.try-gutenberg-panel .try-gutenberg-panel-column > * {
padding-right: 40px;
}
.ie8 .welcome-panel .welcome-panel-column {
min-width: 230px;
}
......@@ -188,11 +225,27 @@
width: 36%;
}
.try-gutenberg-panel .try-gutenberg-panel-column-container {
display: -ms-grid;
display: grid;
-ms-grid-columns: 36% 32% 32%;
grid-template-columns: 36% 32% 32%;
margin-bottom: 13px;
}
.try-gutenberg-panel .try-gutenberg-panel-column:not(.try-gutenberg-panel-image-column) {
display: -ms-grid;
display: grid;
-ms-grid-rows: auto 100px;
grid-template-rows: auto 100px;
}
.welcome-panel-column p.hide-if-no-customize {
margin-top: 10px;
}
.welcome-panel-column p {
.welcome-panel-column p,
.try-gutenberg-panel-column p {
margin-top: 7px;
color: #444;
}
......@@ -202,7 +255,7 @@
}
.welcome-panel .welcome-panel-column ul {
margin: 0.8em 1em 1em 0;
margin: 0.8em 1em 1em 0;
}
.welcome-panel .welcome-panel-column li {
......@@ -1207,6 +1260,17 @@ a.rsswidget {
}
}
@media screen and (max-width: 1024px) {
.try-gutenberg-panel .try-gutenberg-panel-column-container {
-ms-grid-columns: 50% 50%;
grid-template-columns: 50% 50%;
}
.try-gutenberg-panel .try-gutenberg-panel-image-column {
display: none;
}
}
@media screen and (max-width: 870px) {
.welcome-panel .welcome-panel-column,
.welcome-panel .welcome-panel-column:first-child {
......@@ -1215,6 +1279,11 @@ a.rsswidget {
width: 100%;
}
.try-gutenberg-panel .try-gutenberg-panel-column-container {
-ms-grid-columns: 100%;
grid-template-columns: 100%;
}
.welcome-panel .welcome-panel-column li {
display: inline-block;
margin-right: 13px;
......@@ -1223,7 +1292,6 @@ a.rsswidget {
.welcome-panel .welcome-panel-column ul {
margin: 0.4em 0 0;
}
}
@media screen and ( max-width: 782px ) {
......@@ -1266,7 +1334,8 @@ a.rsswidget {
/* Smartphone */
@media screen and (max-width: 600px) {
/* Keep the close icon from overlapping the Welcome text. */
.welcome-panel .welcome-panel-close {
.welcome-panel .welcome-panel-close,
.try-gutenberg-panel .try-gutenberg-panel-close {
overflow: hidden;
text-indent: 40px;
white-space: nowrap;
......@@ -1278,7 +1347,8 @@ a.rsswidget {
}
/* Make the close icon larger for tappability. */
.welcome-panel .welcome-panel-close:before {
.welcome-panel .welcome-panel-close:before,
.try-gutenberg-panel .try-gutenberg-panel-close:before {
font-size: 20px;
top: 5px;
left: -35px;
......
This diff is collapsed.
......@@ -47,6 +47,8 @@ add_action( 'admin_head', '_ipad_meta' );
// Privacy tools
add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
// Prerendering.
if ( ! is_customize_preview() ) {
......@@ -150,3 +152,5 @@ add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_con
// Update the cached policy info when the policy page is updated.
add_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) );
// Append '(Draft)' to draft page titles in the privacy page dropdown.
add_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 );
......@@ -1484,6 +1484,19 @@ function wp_ajax_update_welcome_panel() {
wp_die( 1 );
}
/**
* Ajax handler for updating whether to display the Try Gutenberg panel.
*
* @since 4.9.8
*/
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.
*
......
......@@ -1020,7 +1020,10 @@ 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 ( 2 == $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
if ( '' === $welcome_checked ) {
$welcome_checked = '1';
}
if ( '2' === $welcome_checked && wp_get_current_user()->user_email != get_option( 'admin_email' ) ) {
$welcome_checked = false;
}
}
......@@ -1028,6 +1031,24 @@ final class WP_Screen {
echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />';
echo _x( 'Welcome', 'Welcome panel' ) . "</label>\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 '<label for="wp_try_gutenberg_panel-hide">';
echo '<input type="checkbox" id="wp_try_gutenberg_panel-hide"' . checked( (bool) $try_gutenberg_checked, true, false ) . ' />';
echo __( 'New Editor' ) . "</label>\n";
}
?>
</fieldset>
<?php
......
......@@ -201,6 +201,7 @@ __('Port-au-Prince', 'continents-cities');
__('Porto Acre', 'continents-cities');
__('Porto Velho', 'continents-cities');
__('Puerto Rico', 'continents-cities');
__('Punta Arenas', 'continents-cities');
__('Rainy River', 'continents-cities');
__('Rankin Inlet', 'continents-cities');
__('Recife', 'continents-cities');
......@@ -262,6 +263,7 @@ __('Aqtau', 'continents-cities');
__('Aqtobe', 'continents-cities');
__('Ashgabat', 'continents-cities');
__('Ashkhabad', 'continents-cities');
__('Atyrau', 'continents-cities');
__('Baghdad', 'continents-cities');
__('Bahrain', 'continents-cities');
__('Baku', 'continents-cities');
......@@ -282,6 +284,7 @@ __('Dhaka', 'continents-cities');
__('Dili', 'continents-cities');
__('Dubai', 'continents-cities');
__('Dushanbe', 'continents-cities');
__('Famagusta', 'continents-cities');
__('Gaza', 'continents-cities');
__('Harbin', 'continents-cities');
__('Hebron', 'continents-cities');
......@@ -347,6 +350,7 @@ __('Ust-Nera', 'continents-cities');
__('Vientiane', 'continents-cities');
__('Vladivostok', 'continents-cities');
__('Yakutsk', 'continents-cities');
__('Yangon', 'continents-cities');
__('Yekaterinburg', 'continents-cities');
__('Yerevan', 'continents-cities');
......@@ -471,6 +475,7 @@ __('Rome', 'continents-cities');
__('Samara', 'continents-cities');
__('San Marino', 'continents-cities');
__('Sarajevo', 'continents-cities');
__('Saratov', 'continents-cities');
__('Simferopol', 'continents-cities');
__('Skopje', 'continents-cities');
__('Sofia', 'continents-cities');
......
......@@ -24,6 +24,18 @@ function wp_dashboard_setup() {
/* Register Widgets and Controls */
// Try Gutenberg
// If Gutenberg isn't activated, only show the panel to users who can install and activate it.
$plugins = get_plugins();
if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'install_plugins' ) ) {
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
}
// If Gutenberg is activated, only show it to users who can use it.
if ( is_plugin_active( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'edit_posts' ) ) {
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
}
$response = wp_check_browser_version();
if ( $response && $response['upgrade'] ) {
......@@ -1619,3 +1631,140 @@ function wp_welcome_panel() {
</div>
<?php
}
/**
* Displays a Try Gutenberg Panel, to introduce people to Gutenberg
*
* @since 4.9.8
*/
function wp_try_gutenberg_panel() {
$plugins = get_plugins();
$action = $url = $classes = '';
$classic_action = $classic_url = $classic_classes = '';
if ( current_user_can( 'install_plugins' ) ) {
if ( empty( $plugins['gutenberg/gutenberg.php'] ) ) {