Skip to content

Commit

Permalink
Fixed "Automatic conversion of false to array is deprecated" error in…
Browse files Browse the repository at this point in the history
… php 8.1

Deprecated: Automatic conversion of false to array is deprecated in /acf-icomoon/fields/icomoon-base-field.php on line 71
  • Loading branch information
chrissilich committed Aug 30, 2023
1 parent 1bd4bdb commit 5c6ddd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fields/icomoon-base-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ public function parse_css() {
return $out;
}

$out = [];

// If not extract them from the CSS file
$contents = file_get_contents( $filepath );

preg_match_all( '#.icon-(.*)::before#', $contents, $css );
array_shift( $css );


foreach ( $css[0] as $cs ) {
$out[] = array( 'id' => $cs, 'text' => $cs );
}
Expand Down

0 comments on commit 5c6ddd2

Please sign in to comment.