In PHP 7.4 i'm getting this notice: Trying to access array offset on value of type bool in
if( $book_font ){
foreach ( $book_font as $key => $font ) {
if ( in_array( $font['face'], $all_google_fonts ) ) {
self::options_typography_enqueue_google_font( $font['face'] );
}
}
}
Notice for this line:
if ( in_array( $font['face'], $all_google_fonts ) ) {
The error means in
foreachloop, one or more value of$fontis a boolean instead of an array.One way to fix it is by using null coalescing operator
??like this: