Skip to content

Commit

Permalink
Preload paths: avoid fatal error on Widgets page.
Browse files Browse the repository at this point in the history
Follow-up to WordPress#39256
  • Loading branch information
jeherve committed Mar 17, 2022
1 parent d7dc3cd commit fa005a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.0/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function optimize_preload_paths( $preload_paths ) {

// modify the preload of `/users/me` to match the real request.
foreach ( $preload_paths as $user_index => $user_path ) {
if ( 0 === strpos( $user_path, '/wp/v2/users/me' ) ) {
if ( is_string( $user_path ) && 0 === strpos( $user_path, '/wp/v2/users/me' ) ) {
$preload_paths[ $user_index ] = '/wp/v2/users/me';
break;
}
Expand Down

0 comments on commit fa005a6

Please sign in to comment.