Skip to content

Commit

Permalink
Preload paths: avoid fatal error on Widgets page. (WordPress#39470)
Browse files Browse the repository at this point in the history
Follow-up to WordPress#39256
  • Loading branch information
jeherve authored and jostnes committed Mar 23, 2022
1 parent efb48de commit ee13f3c
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 ee13f3c

Please sign in to comment.