Skip to content

Commit 464e5e2

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents a1c0ec0 + d5b7d49 commit 464e5e2

10 files changed

Lines changed: 151 additions & 125 deletions

File tree

src/wp-admin/edit-form-blocks.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ static function( $classes ) {
5757

5858
// Preload common data.
5959
$preload_paths = array(
60-
'/',
6160
'/wp/v2/types?context=edit',
62-
'/wp/v2/taxonomies?per_page=-1&context=edit',
61+
'/wp/v2/taxonomies?context=edit',
6362
'/wp/v2/themes?status=active',
6463
add_query_arg( 'context', 'edit', $rest_path ),
6564
sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
66-
sprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ),
65+
'/wp/v2/users/me',
6766
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
6867
array( rest_get_route_for_post_type_items( 'wp_block' ), 'OPTIONS' ),
6968
sprintf( '%s/autosaves?context=edit', $rest_path ),
69+
'/wp/v2/settings',
7070
);
7171

7272
block_editor_rest_api_preload( $preload_paths, $block_editor_context );

src/wp-admin/includes/class-ftp.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ function glob($pattern, $handle=NULL) {
792792
return false;
793793
}
794794

795-
function glob_pattern_match($pattern,$string) {
795+
function glob_pattern_match($pattern,$subject) {
796796
$out=null;
797797
$chunks=explode(';',$pattern);
798798
foreach($chunks as $pattern) {
@@ -807,19 +807,20 @@ function glob_pattern_match($pattern,$string) {
807807
str_replace('?','.{1,1}',$pattern))));
808808
$out[]=$pattern;
809809
}
810-
if(count($out)==1) return($this->glob_regexp("^$out[0]$",$string));
810+
if(count($out)==1) return($this->glob_regexp("^$out[0]$",$subject));
811811
else {
812812
foreach($out as $tester)
813-
if($this->my_regexp("^$tester$",$string)) return true;
813+
// TODO: This should probably be glob_regexp(), but needs tests.
814+
if($this->my_regexp("^$tester$",$subject)) return true;
814815
}
815816
return false;
816817
}
817818

818-
function glob_regexp($pattern,$probe) {
819+
function glob_regexp($pattern,$subject) {
819820
$sensitive=(PHP_OS!='WIN32');
820821
return ($sensitive?
821-
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $probe ) :
822-
preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $probe )
822+
preg_match( '/' . preg_quote( $pattern, '/' ) . '/', $subject ) :
823+
preg_match( '/' . preg_quote( $pattern, '/' ) . '/i', $subject )
823824
);
824825
}
825826

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -505,19 +505,19 @@ public function plugin_info() {
505505
* @since 2.8.0
506506
* @since 4.1.0 Added a return value.
507507
*
508-
* @param bool|WP_Error $return Upgrade offer return.
509-
* @param array $plugin Plugin package arguments.
510-
* @return bool|WP_Error The passed in $return param or WP_Error.
508+
* @param bool|WP_Error $response The installation response before the installation has started.
509+
* @param array $plugin Plugin package arguments.
510+
* @return bool|WP_Error The original `$response` parameter or WP_Error.
511511
*/
512-
public function deactivate_plugin_before_upgrade( $return, $plugin ) {
512+
public function deactivate_plugin_before_upgrade( $response, $plugin ) {
513513

514-
if ( is_wp_error( $return ) ) { // Bypass.
515-
return $return;
514+
if ( is_wp_error( $response ) ) { // Bypass.
515+
return $response;
516516
}
517517

518518
// When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it.
519519
if ( wp_doing_cron() ) {
520-
return $return;
520+
return $response;
521521
}
522522

523523
$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
@@ -530,7 +530,7 @@ public function deactivate_plugin_before_upgrade( $return, $plugin ) {
530530
deactivate_plugins( $plugin, true );
531531
}
532532

533-
return $return;
533+
return $response;
534534
}
535535

536536
/**
@@ -540,33 +540,33 @@ public function deactivate_plugin_before_upgrade( $return, $plugin ) {
540540
*
541541
* @since 5.4.0
542542
*
543-
* @param bool|WP_Error $return Upgrade offer return.
544-
* @param array $plugin Plugin package arguments.
545-
* @return bool|WP_Error The passed in $return param or WP_Error.
543+
* @param bool|WP_Error $response The installation response before the installation has started.
544+
* @param array $plugin Plugin package arguments.
545+
* @return bool|WP_Error The original `$response` parameter or WP_Error.
546546
*/
547-
public function active_before( $return, $plugin ) {
548-
if ( is_wp_error( $return ) ) {
549-
return $return;
547+
public function active_before( $response, $plugin ) {
548+
if ( is_wp_error( $response ) ) {
549+
return $response;
550550
}
551551

552552
// Only enable maintenance mode when in cron (background update).
553553
if ( ! wp_doing_cron() ) {
554-
return $return;
554+
return $response;
555555
}
556556

557557
$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
558558

559559
// Only run if plugin is active.
560560
if ( ! is_plugin_active( $plugin ) ) {
561-
return $return;
561+
return $response;
562562
}
563563

564564
// Change to maintenance mode. Bulk edit handles this separately.
565565
if ( ! $this->bulk ) {
566566
$this->maintenance_mode( true );
567567
}
568568

569-
return $return;
569+
return $response;
570570
}
571571

572572
/**
@@ -576,33 +576,33 @@ public function active_before( $return, $plugin ) {
576576
*
577577
* @since 5.4.0
578578
*
579-
* @param bool|WP_Error $return Upgrade offer return.
580-
* @param array $plugin Plugin package arguments.
581-
* @return bool|WP_Error The passed in $return param or WP_Error.
579+
* @param bool|WP_Error $response The installation response after the installation has finished.
580+
* @param array $plugin Plugin package arguments.
581+
* @return bool|WP_Error The original `$response` parameter or WP_Error.
582582
*/
583-
public function active_after( $return, $plugin ) {
584-
if ( is_wp_error( $return ) ) {
585-
return $return;
583+
public function active_after( $response, $plugin ) {
584+
if ( is_wp_error( $response ) ) {
585+
return $response;
586586
}
587587

588588
// Only disable maintenance mode when in cron (background update).
589589
if ( ! wp_doing_cron() ) {
590-
return $return;
590+
return $response;
591591
}
592592

593593
$plugin = isset( $plugin['plugin'] ) ? $plugin['plugin'] : '';
594594

595-
// Only run if plugin is active
595+
// Only run if plugin is active.
596596
if ( ! is_plugin_active( $plugin ) ) {
597-
return $return;
597+
return $response;
598598
}
599599

600600
// Time to remove maintenance mode. Bulk edit handles this separately.
601601
if ( ! $this->bulk ) {
602602
$this->maintenance_mode( false );
603603
}
604604

605-
return $return;
605+
return $response;
606606
}
607607

608608
/**

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -616,28 +616,28 @@ public function check_package( $source ) {
616616
*
617617
* @since 2.8.0
618618
*
619-
* @param bool|WP_Error $return Upgrade offer return.
620-
* @param array $theme Theme arguments.
621-
* @return bool|WP_Error The passed in $return param or WP_Error.
619+
* @param bool|WP_Error $response The installation response before the installation has started.
620+
* @param array $theme Theme arguments.
621+
* @return bool|WP_Error The original `$response` parameter or WP_Error.
622622
*/
623-
public function current_before( $return, $theme ) {
624-
if ( is_wp_error( $return ) ) {
625-
return $return;
623+
public function current_before( $response, $theme ) {
624+
if ( is_wp_error( $response ) ) {
625+
return $response;
626626
}
627627

628628
$theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
629629

630-
// Only run if active theme
630+
// Only run if active theme.
631631
if ( get_stylesheet() !== $theme ) {
632-
return $return;
632+
return $response;
633633
}
634634

635635
// Change to maintenance mode. Bulk edit handles this separately.
636636
if ( ! $this->bulk ) {
637637
$this->maintenance_mode( true );
638638
}
639639

640-
return $return;
640+
return $response;
641641
}
642642

643643
/**
@@ -648,20 +648,20 @@ public function current_before( $return, $theme ) {
648648
*
649649
* @since 2.8.0
650650
*
651-
* @param bool|WP_Error $return Upgrade offer return.
652-
* @param array $theme Theme arguments.
653-
* @return bool|WP_Error The passed in $return param or WP_Error.
651+
* @param bool|WP_Error $response The installation response after the installation has finished.
652+
* @param array $theme Theme arguments.
653+
* @return bool|WP_Error The original `$response` parameter or WP_Error.
654654
*/
655-
public function current_after( $return, $theme ) {
656-
if ( is_wp_error( $return ) ) {
657-
return $return;
655+
public function current_after( $response, $theme ) {
656+
if ( is_wp_error( $response ) ) {
657+
return $response;
658658
}
659659

660660
$theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
661661

662662
// Only run if active theme.
663663
if ( get_stylesheet() !== $theme ) {
664-
return $return;
664+
return $response;
665665
}
666666

667667
// Ensure stylesheet name hasn't changed after the upgrade:
@@ -675,7 +675,7 @@ public function current_after( $return, $theme ) {
675675
if ( ! $this->bulk ) {
676676
$this->maintenance_mode( false );
677677
}
678-
return $return;
678+
return $response;
679679
}
680680

681681
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,14 +477,14 @@ public function install_package( $args = array() ) {
477477
$this->skin->feedback( 'installing_package' );
478478

479479
/**
480-
* Filters the install response before the installation has started.
480+
* Filters the installation response before the installation has started.
481481
*
482482
* Returning a value that could be evaluated as a `WP_Error` will effectively
483483
* short-circuit the installation, returning that value instead.
484484
*
485485
* @since 2.8.0
486486
*
487-
* @param bool|WP_Error $response Response.
487+
* @param bool|WP_Error $response Installation response.
488488
* @param array $hook_extra Extra arguments passed to hooked filters.
489489
*/
490490
$res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );

src/wp-admin/site-editor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ static function( $classes ) {
7272
$active_theme = wp_get_theme()->get_stylesheet();
7373
$preload_paths = array(
7474
array( '/wp/v2/media', 'OPTIONS' ),
75-
'/',
7675
'/wp/v2/types?context=edit',
7776
'/wp/v2/types/wp_template?context=edit',
7877
'/wp/v2/types/wp_template-part?context=edit',

src/wp-includes/class-wp-query.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,7 @@ public function get_posts() {
32633263
'post__in' => $sticky_posts,
32643264
'post_type' => $post_type,
32653265
'post_status' => 'publish',
3266+
'posts_per_page' => count( $sticky_posts ),
32663267
'suppress_filters' => $q['suppress_filters'],
32673268
'cache_results' => $q['cache_results'],
32683269
'update_post_meta_cache' => $q['update_post_meta_cache'],

src/wp-includes/rewrite.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function add_rewrite_rule( $regex, $query, $after = 'bottom' ) {
144144
}
145145

146146
/**
147-
* Add a new rewrite tag (like %postname%).
147+
* Adds a new rewrite tag (like %postname%).
148148
*
149149
* The `$query` parameter is optional. If it is omitted you must ensure that you call
150150
* this on, or before, the {@see 'init'} hook. This is because `$query` defaults to
@@ -191,7 +191,7 @@ function remove_rewrite_tag( $tag ) {
191191
}
192192

193193
/**
194-
* Add permalink structure.
194+
* Adds a permalink structure.
195195
*
196196
* @since 3.0.0
197197
*
@@ -237,7 +237,7 @@ function remove_permastruct( $name ) {
237237
}
238238

239239
/**
240-
* Add a new feed type like /atom1/.
240+
* Adds a new feed type like /atom1/.
241241
*
242242
* @since 2.1.0
243243
*
@@ -265,7 +265,7 @@ function add_feed( $feedname, $function ) {
265265
}
266266

267267
/**
268-
* Remove rewrite rules and then recreate rewrite rules.
268+
* Removes rewrite rules and then recreate rewrite rules.
269269
*
270270
* @since 3.0.0
271271
*
@@ -283,7 +283,7 @@ function flush_rewrite_rules( $hard = true ) {
283283
}
284284

285285
/**
286-
* Add an endpoint, like /trackback/.
286+
* Adds an endpoint, like /trackback/.
287287
*
288288
* Adding an endpoint creates extra rewrite rules for each of the matching
289289
* places specified by the provided bitmask. For example:
@@ -357,7 +357,7 @@ function _wp_filter_taxonomy_base( $base ) {
357357

358358

359359
/**
360-
* Resolve numeric slugs that collide with date permalinks.
360+
* Resolves numeric slugs that collide with date permalinks.
361361
*
362362
* Permalinks of posts with numeric slugs can sometimes look to WP_Query::parse_query()
363363
* like a date archive, as when your permalink structure is `/%year%/%postname%/` and
@@ -473,7 +473,7 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {
473473
}
474474

475475
/**
476-
* Examine a URL and try to determine the post ID it represents.
476+
* Examines a URL and try to determine the post ID it represents.
477477
*
478478
* Checks are supposedly from the hosted site blog.
479479
*

0 commit comments

Comments
 (0)