Skip to content

Commit ed1724d

Browse files
committed
Update code & fix typos.
1 parent b1dd006 commit ed1724d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+952
-1202
lines changed

wp-admin/admin-footer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</div>
6464
<?php
6565
/**
66-
* Print scripts or data before the default footer scripts.
66+
* Prints scripts or data before the default footer scripts.
6767
*
6868
* @since 1.2.0
6969
*
@@ -92,7 +92,7 @@
9292
do_action( 'admin_print_footer_scripts' );
9393

9494
/**
95-
* Print scripts or data after the default footer scripts.
95+
* Prints scripts or data after the default footer scripts.
9696
*
9797
* The dynamic portion of the hook name, `$hook_suffix`,
9898
* refers to the global hook suffix of the current page.

wp-admin/admin-header.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,29 +229,29 @@
229229

230230
if ( is_network_admin() ) {
231231
/**
232-
* Print network admin screen notices.
232+
* Prints network admin screen notices.
233233
*
234234
* @since 3.1.0
235235
*/
236236
do_action( 'network_admin_notices' );
237237
} elseif ( is_user_admin() ) {
238238
/**
239-
* Print user admin screen notices.
239+
* Prints user admin screen notices.
240240
*
241241
* @since 3.1.0
242242
*/
243243
do_action( 'user_admin_notices' );
244244
} else {
245245
/**
246-
* Print admin screen notices.
246+
* Prints admin screen notices.
247247
*
248248
* @since 3.1.0
249249
*/
250250
do_action( 'admin_notices' );
251251
}
252252

253253
/**
254-
* Print generic admin screen notices.
254+
* Prints generic admin screen notices.
255255
*
256256
* @since 3.1.0
257257
*/

wp-admin/css/customize-controls-rtl.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ p.customize-section-description {
636636

637637
#customize-controls .customize-control-widget_form.has-error .widget .widget-top,
638638
.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle {
639+
-webkit-box-shadow: inset 0 0 0 2px #dc3232;
639640
box-shadow: inset 0 0 0 2px #dc3232;
641+
-webkit-transition: .15s box-shadow linear;
640642
transition: .15s box-shadow linear;
641643
}
642644

wp-admin/css/customize-controls-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/customize-controls.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ p.customize-section-description {
636636

637637
#customize-controls .customize-control-widget_form.has-error .widget .widget-top,
638638
.customize-control-nav_menu_item.has-error .menu-item-bar .menu-item-handle {
639+
-webkit-box-shadow: inset 0 0 0 2px #dc3232;
639640
box-shadow: inset 0 0 0 2px #dc3232;
641+
-webkit-transition: .15s box-shadow linear;
640642
transition: .15s box-shadow linear;
641643
}
642644

wp-admin/css/customize-controls.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/edit-rtl.css

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,6 @@ form#tags-filter {
377377
position: relative;
378378
}
379379

380-
#content-textarea-clone {
381-
z-index: -1;
382-
position: absolute;
383-
top: 0;
384-
visibility: hidden;
385-
overflow: hidden;
386-
max-width: 100%;
387-
border: 1px solid transparent;
388-
}
389-
390380
.wp-editor-expand #wp-content-editor-tools {
391381
z-index: 1000;
392382
border-bottom: 1px solid #e5e5e5;
@@ -644,19 +634,6 @@ span.wp-media-buttons-icon:before {
644634
max-width: 100%;
645635
}
646636

647-
#poststuff .inside label.spam,
648-
#poststuff .inside label.deleted {
649-
color: red;
650-
}
651-
652-
#poststuff .inside label.waiting {
653-
color: orange;
654-
}
655-
656-
#poststuff .inside label.approved {
657-
color: green;
658-
}
659-
660637
.ie8 #poststuff .inside #parent_id,
661638
.ie8 #poststuff .inside #page_template {
662639
width: 250px;
@@ -1139,6 +1116,7 @@ p.popular-tags a {
11391116
padding: 0 4px;
11401117
color: #72777C;
11411118
font-size: 13px;
1119+
word-break: break-all;
11421120
}
11431121

11441122
.comment-ays .comment-content p.edit-comment {

wp-admin/css/edit-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/edit.css

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,6 @@ form#tags-filter {
377377
position: relative;
378378
}
379379

380-
#content-textarea-clone {
381-
z-index: -1;
382-
position: absolute;
383-
top: 0;
384-
visibility: hidden;
385-
overflow: hidden;
386-
max-width: 100%;
387-
border: 1px solid transparent;
388-
}
389-
390380
.wp-editor-expand #wp-content-editor-tools {
391381
z-index: 1000;
392382
border-bottom: 1px solid #e5e5e5;
@@ -644,19 +634,6 @@ span.wp-media-buttons-icon:before {
644634
max-width: 100%;
645635
}
646636

647-
#poststuff .inside label.spam,
648-
#poststuff .inside label.deleted {
649-
color: red;
650-
}
651-
652-
#poststuff .inside label.waiting {
653-
color: orange;
654-
}
655-
656-
#poststuff .inside label.approved {
657-
color: green;
658-
}
659-
660637
.ie8 #poststuff .inside #parent_id,
661638
.ie8 #poststuff .inside #page_template {
662639
width: 250px;
@@ -1139,6 +1116,7 @@ p.popular-tags a {
11391116
padding: 0 4px;
11401117
color: #72777C;
11411118
font-size: 13px;
1119+
word-break: break-all;
11421120
}
11431121

11441122
.comment-ays .comment-content p.edit-comment {

wp-admin/css/edit.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
<?php
179179

180180
/**
181-
* Print templates, control scripts, and settings in the footer.
181+
* Prints templates, control scripts, and settings in the footer.
182182
*
183183
* @since 3.4.0
184184
*/

wp-admin/edit-form-comment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@
8282

8383
<fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
8484
<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
85-
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
86-
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
87-
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
85+
<label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
86+
<label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
87+
<label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
8888
</fieldset>
8989

9090
<div class="misc-pub-section curtime misc-pub-curtime">

wp-admin/includes/admin-filters.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
add_action( 'admin_head', 'wp_site_icon' );
4444
add_action( 'admin_head', '_ipad_meta' );
4545

46-
add_action( 'post_edit_form_tag', 'post_form_autocomplete_off' );
46+
add_action( 'admin_print_scripts-post.php', 'wp_page_reload_on_back_button_js' );
47+
add_action( 'admin_print_scripts-post-new.php', 'wp_page_reload_on_back_button_js' );
4748

4849
add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
4950
add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
@@ -109,3 +110,6 @@
109110

110111
// Upgrade hooks.
111112
add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
113+
add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
114+
add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
115+
add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );

wp-admin/includes/ajax-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ function wp_ajax_get_comments( $action ) {
951951
$x = new WP_Ajax_Response();
952952
ob_start();
953953
foreach ( $wp_list_table->items as $comment ) {
954-
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
954+
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && 0 === $comment->comment_approved )
955955
continue;
956956
get_comment( $comment );
957957
$wp_list_table->single_row( $comment );

wp-admin/includes/class-wp-comments-list-table.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ protected function get_views() {
201201

202202
$status_links = array();
203203
$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
204-
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
205-
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
204+
206205
$stati = array(
207206
/* translators: %s: all comments count */
208207
'all' => _nx_noop(

wp-admin/includes/class-wp-upgrader.php

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ public function run( $options ) {
651651
/**
652652
* Filters the package options before running an update.
653653
*
654+
* See also {@see 'upgrader_process_complete'}.
655+
*
654656
* @since 4.3.0
655657
*
656658
* @param array $options {
@@ -662,7 +664,18 @@ public function run( $options ) {
662664
* @type bool $clear_working Clear the working resource.
663665
* @type bool $abort_if_destination_exists Abort if the Destination directory exists.
664666
* @type bool $is_multi Whether the upgrader is running multiple times.
665-
* @type array $hook_extra Extra hook arguments.
667+
* @type array $hook_extra {
668+
* Extra hook arguments.
669+
*
670+
* @type string $action Type of action. Default 'update'.
671+
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
672+
* @type bool $bulk Whether the update process is a bulk update. Default true.
673+
* @type string $plugin The base plugin path from the plugins directory.
674+
* @type string $theme The stylesheet or template name of the theme.
675+
* @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
676+
* or 'core'.
677+
* @type object $language_update The language pack update offer.
678+
* }
666679
* }
667680
*/
668681
$options = apply_filters( 'upgrader_package_options', $options );
@@ -745,6 +758,8 @@ public function run( $options ) {
745758
/**
746759
* Fires when the upgrader process is complete.
747760
*
761+
* See also {@see 'upgrader_package_options'}.
762+
*
748763
* @since 3.6.0
749764
* @since 3.7.0 Added to WP_Upgrader::run().
750765
*
@@ -753,14 +768,11 @@ public function run( $options ) {
753768
* @param array $hook_extra {
754769
* Array of bulk item update data.
755770
*
756-
* @type string $action Type of action. Default 'update'.
757-
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
758-
* @type bool $bulk Whether the update process is a bulk update. Default true.
759-
* @type string $plugin The base plugin path from the plugins directory.
760-
* @type string $theme The stylesheet or template name of the theme.
761-
* @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
762-
* or 'core'.
763-
* @type object $language_update The language pack update offer.
771+
* @type string $action Type of action. Default 'update'.
772+
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
773+
* @type bool $bulk Whether the update process is a bulk update. Default true.
774+
* @type array $plugins Array of the basename paths of the plugins' main files.
775+
* @type array $themes The theme slugs.
764776
* }
765777
*/
766778
do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );

wp-admin/includes/deprecated.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,3 +1373,26 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f
13731373

13741374
return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
13751375
}
1376+
1377+
/**
1378+
* Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
1379+
* as they disregard the autocomplete setting on the editor textarea. That can break the editor
1380+
* when the user navigates to it with the browser's Back button. See #28037
1381+
*
1382+
* Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
1383+
*
1384+
* @since 4.0.0
1385+
* $deprecated 4.6.0
1386+
*
1387+
* @global bool $is_safari
1388+
* @global bool $is_chrome
1389+
*/
1390+
function post_form_autocomplete_off() {
1391+
global $is_safari, $is_chrome;
1392+
1393+
_deprecated_function( __FUNCTION__, '4.6' );
1394+
1395+
if ( $is_safari || $is_chrome ) {
1396+
echo ' autocomplete="off"';
1397+
}
1398+
}

wp-admin/includes/file.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ function download_url( $url, $timeout = 300 ) {
493493
if ( ! $url )
494494
return new WP_Error('http_no_url', __('Invalid URL Provided.'));
495495

496-
$tmpfname = wp_tempnam($url);
496+
$url_filename = basename( parse_url( $url, PHP_URL_PATH ) );
497+
498+
$tmpfname = wp_tempnam( $url_filename );
497499
if ( ! $tmpfname )
498500
return new WP_Error('http_no_file', __('Could not create Temporary file.'));
499501

wp-admin/includes/misc.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -891,24 +891,6 @@ function heartbeat_autosave( $response, $data ) {
891891
return $response;
892892
}
893893

894-
/**
895-
* Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
896-
* as they disregard the autocomplete setting on the editor textarea. That can break the editor
897-
* when the user navigates to it with the browser's Back button. See #28037
898-
*
899-
* @since 4.0.0
900-
*
901-
* @global bool $is_safari
902-
* @global bool $is_chrome
903-
*/
904-
function post_form_autocomplete_off() {
905-
global $is_safari, $is_chrome;
906-
907-
if ( $is_safari || $is_chrome ) {
908-
echo ' autocomplete="off"';
909-
}
910-
}
911-
912894
/**
913895
* Remove single-use URL parameters and create canonical link based on new URL.
914896
*
@@ -936,3 +918,21 @@ function wp_admin_canonical_url() {
936918
</script>
937919
<?php
938920
}
921+
922+
/**
923+
* Output JS that reloads the page if the user navigated to it with the Back or Forward button.
924+
*
925+
* Used on the Edit Post and Add New Post screens. Needed to ensure the page is not loaded from browser cache,
926+
* so the post title and editor content are the last saved versions. Ideally this script should run first in the head.
927+
*
928+
* @since 4.6.0
929+
*/
930+
function wp_page_reload_on_back_button_js() {
931+
?>
932+
<script>
933+
if ( typeof performance !== 'undefined' && performance.navigation && performance.navigation.type === 2 ) {
934+
document.location.reload( true );
935+
}
936+
</script>
937+
<?php
938+
}

0 commit comments

Comments
 (0)