WidgetOptions / widget-options

Additional Widget options for better widget control. Available on
https://widget-options.com/
GNU General Public License v3.0
35 stars 16 forks source link

ACF repeater fields type error with array_filter #92

Open mikeprince opened 4 years ago

mikeprince commented 4 years ago

The processing of ACF repeater fields produces PHP errors whether ACF is returning post_id or post_object. For the former the error is:

Warning: array_filter() expects parameter 1 to be array, integer given in... \wp-content\plugins\widget-options\includes\widgets\display.php on line 232

and the latter is:

Warning: array_filter() expects parameter 1 to be array, object given in... \wp-content\plugins\widget-options\includes\widgets\display.php on line 232

The fix for either case I believe is to cast to an array by changing line 232 of display.php from: $acf_implode = implode( ',', array_filter( $acf_array_value) ); to: $acf_implode = implode( ',', array_filter( (array) $acf_array_value) );