Update WordPress to latest nightly.

parent cc5d7142
......@@ -139,6 +139,7 @@ $core_actions_post = array(
'health-check-background-updates',
'health-check-loopback-requests',
'health-check-get-sizes',
'toggle-auto-updates',
);
// Deprecated.
......
......@@ -44,7 +44,7 @@ if ( is_network_admin() ) {
$admin_title = get_bloginfo( 'name' );
}
if ( $admin_title == $title ) {
if ( $admin_title === $title ) {
/* translators: Admin screen title. %s: Admin screen name. */
$admin_title = sprintf( __( '%s — WordPress' ), $title );
} else {
......@@ -75,14 +75,13 @@ _wp_admin_html_begin();
<?php
wp_enqueue_style( 'colors' );
wp_enqueue_style( 'ie' );
wp_enqueue_script( 'utils' );
wp_enqueue_script( 'svg-painter' );
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
pagenow = '<?php echo $current_screen->id; ?>',
typenow = '<?php echo $current_screen->post_type; ?>',
......@@ -91,7 +90,6 @@ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<?php
/**
......@@ -148,7 +146,7 @@ do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConven
*/
do_action( 'admin_head' );
if ( get_user_setting( 'mfold' ) == 'f' ) {
if ( 'f' === get_user_setting( 'mfold' ) ) {
$admin_body_class .= ' folded';
}
......@@ -200,6 +198,11 @@ if ( $current_screen->is_block_editor() ) {
}
}
// Print a CSS class to make PHP errors visible.
if ( error_get_last() && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' ) ) {
$admin_body_class .= ' php-error';
}
?>
</head>
<?php
......
......@@ -36,6 +36,7 @@ require_once dirname( __DIR__ ) . '/wp-load.php';
nocache_headers();
if ( get_option( 'db_upgraded' ) ) {
flush_rewrite_rules();
update_option( 'db_upgraded', false );
......@@ -45,7 +46,9 @@ if ( get_option( 'db_upgraded' ) ) {
* @since 2.8.0
*/
do_action( 'after_db_upgrade' );
} elseif ( get_option( 'db_version' ) != $wp_db_version && empty( $_POST ) ) {
} elseif ( (int) get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) {
if ( ! is_multisite() ) {
wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
exit;
......@@ -289,7 +292,7 @@ if ( isset( $plugin_page ) ) {
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit();
exit;
} elseif ( isset( $_GET['import'] ) ) {
$importer = $_GET['import'];
......@@ -350,7 +353,7 @@ if ( isset( $plugin_page ) ) {
// Make sure rules are flushed.
flush_rewrite_rules( false );
exit();
exit;
} else {
/**
* Fires before a particular screen is loaded.
......
......@@ -42,12 +42,9 @@ if ( ! current_user_can( 'upload_files' ) ) {
if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) {
$id = intval( $_REQUEST['attachment_id'] );
$post = get_post( $id );
if ( 'attachment' != $post->post_type ) {
if ( 'attachment' !== $post->post_type ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! current_user_can( 'edit_post', $id ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
}
switch ( $_REQUEST['fetch'] ) {
case 3:
......@@ -55,7 +52,11 @@ if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] )
if ( $thumb_url ) {
echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
}
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
if ( current_user_can( 'edit_post', $id ) ) {
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
} else {
echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>';
}
// Title shouldn't ever be empty, but use filename just in case.
$file = get_attached_file( $post->ID );
......
......@@ -22,20 +22,30 @@ if ( isset( $_POST['deletecomment'] ) ) {
$action = 'deletecomment';
}
if ( 'cdc' == $action ) {
if ( 'cdc' === $action ) {
$action = 'delete';
} elseif ( 'mac' == $action ) {
} elseif ( 'mac' === $action ) {
$action = 'approve';
}
if ( isset( $_GET['dt'] ) ) {
if ( 'spam' == $_GET['dt'] ) {
if ( 'spam' === $_GET['dt'] ) {
$action = 'spam';
} elseif ( 'trash' == $_GET['dt'] ) {
} elseif ( 'trash' === $_GET['dt'] ) {
$action = 'trash';
}
}
$comment_id = absint( $_GET['c'] );
$comment = get_comment( $comment_id );
// Prevent actions on a comment associated with a trashed post.
if ( 'trash' === get_post_status( $comment->comment_post_ID ) ) {
wp_die(
__( 'You can&#8217;t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' )
);
}
switch ( $action ) {
case 'editcomment':
......@@ -60,9 +70,6 @@ switch ( $action ) {
wp_enqueue_script( 'comment' );
require_once ABSPATH . 'wp-admin/admin-header.php';
$comment_id = absint( $_GET['c'] );
$comment = get_comment( $comment_id );
if ( ! $comment ) {
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) );
}
......@@ -71,7 +78,7 @@ switch ( $action ) {
comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) );
}
if ( 'trash' == $comment->comment_approved ) {
if ( 'trash' === $comment->comment_approved ) {
comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) );
}
......@@ -87,9 +94,6 @@ switch ( $action ) {
case 'spam':
$title = __( 'Moderate Comment' );
$comment_id = absint( $_GET['c'] );
$comment = get_comment( $comment_id );
if ( ! $comment ) {
wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
die();
......@@ -101,7 +105,7 @@ switch ( $action ) {
}
// No need to re-approve/re-trash/re-spam a comment.
if ( str_replace( '1', 'approve', $comment->comment_approved ) == $action ) {
if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) {
wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
die();
}
......@@ -109,7 +113,7 @@ switch ( $action ) {
require_once ABSPATH . 'wp-admin/admin-header.php';
$formaction = $action . 'comment';
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
$nonce_action = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_';
$nonce_action .= $comment_id;
?>
......@@ -121,23 +125,23 @@ switch ( $action ) {
switch ( $action ) {
case 'spam':
$caution_msg = __( 'You are about to mark the following comment as spam:' );
$button = _x( 'Mark as Spam', 'comment' );
$button = _x( 'Mark as spam', 'comment' );
break;
case 'trash':
$caution_msg = __( 'You are about to move the following comment to the Trash:' );
$button = __( 'Move to Trash' );
$button = __( 'Move to trash' );
break;
case 'delete':
$caution_msg = __( 'You are about to delete the following comment:' );
$button = __( 'Permanently Delete Comment' );
$button = __( 'Permanently delete comment' );
break;
default:
$caution_msg = __( 'You are about to approve the following comment:' );
$button = __( 'Approve Comment' );
$button = __( 'Approve comment' );
break;
}
if ( '0' != $comment->comment_approved ) { // If not unapproved.
if ( '0' !== $comment->comment_approved ) { // If not unapproved.
$message = '';
switch ( $comment->comment_approved ) {
case '1':
......@@ -175,7 +179,7 @@ switch ( $action ) {
</tr>
<?php } ?>
<tr>
<th scope="row"><?php /* translators: Column name or table row header. */ _e( 'In Response To' ); ?></th>
<th scope="row"><?php /* translators: Column name or table row header. */ _e( 'In response to' ); ?></th>
<td>
<?php
$post_id = $comment->comment_post_ID;
......@@ -271,9 +275,9 @@ switch ( $action ) {
comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
}
if ( '' != wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
if ( wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
$redir = wp_get_referer();
} elseif ( '' != wp_get_original_referer() && ! $noredir ) {
} elseif ( wp_get_original_referer() && ! $noredir ) {
$redir = wp_get_original_referer();
} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
$redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
......@@ -335,7 +339,10 @@ switch ( $action ) {
check_admin_referer( 'update-comment_' . $comment_id );
edit_comment();
$updated = edit_comment();
if ( is_wp_error( $updated ) ) {
wp_die( $updated->get_error_message() );
}
$location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
......@@ -348,9 +355,9 @@ switch ( $action ) {
* @param int $comment_id The ID of the comment being edited.
*/
$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
wp_redirect( $location );
exit();
wp_redirect( $location );
exit;
default:
wp_die( __( 'Unknown action.' ) );
......
......@@ -318,7 +318,8 @@
line-height: 1.4;
}
.about__container h3 {
.about__container h3,
.about__container h2.is-smaller-heading {
margin-top: 0;
font-size: 1em;
}
......
This diff is collapsed.
......@@ -317,7 +317,8 @@
line-height: 1.4;
}
.about__container h3 {
.about__container h3,
.about__container h2.is-smaller-heading {
margin-top: 0;
font-size: 1em;
}
......
This diff is collapsed.
......@@ -14,6 +14,15 @@
z-index: 1; /* positive z-index to avoid elastic scrolling woes in Safari */
}
.php-error #adminmenuback {
position: absolute;
}