Fatal error in Customizer: in_array() expects array, string given (PHP 8+)
-
Hello,
We are experiencing a fatal PHP error that completely breaks the WordPress Customizer when the Beautiful Taxonomy Filters plugin is active.
We see this screen:

Environment
- WordPress: Latest version
- Theme: Astra 4.11.16
- PHP Version: 8+
- Plugin: Beautiful Taxonomy Filters
- Issue occurs when navigating to Appearance → Customize
We also receive an email with the following error:
An error of type E_ERROR was caused in line 107 of the file /nas/content/live/astra-theme-ext/wp-content/plugins/beautiful-taxonomy-filters/widgets/beautiful-taxonomy-filters-widget.php. Error message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /nas/content/live/astra-theme-ext/wp-content/plugins/beautiful-taxonomy-filters/widgets/beautiful-taxonomy-filters-widget.php:107
Stack trace:
#0 /nas/content/live/astra-theme-ext/wp-content/plugins/beautiful-taxonomy-filters/widgets/beautiful-taxonomy-filters-widget.php(107): in_array('elementor_libra...', '')
#1 /nas/content/live/astra-theme-ext/wp-includes/class-wp-widget.php(535): Beautiful_Taxonomy_Filters_Widget->form(Array)
#2 /nas/content/live/astra-theme-ext/wp-admin/includes/widgets.php(276): WP_Widget->form_callback(Array)
#3 /nas/content/live/astra-theme-ext/wp-includes/class-wp-customize-widgets.php(1169): wp_widget_control(Array, Array)
#4 /nas/content/live/astra-theme-ext/wp-includes/class-wp-customize-widgets.php(1117): WP_Customize_Widgets->get_widget_control(Array)
#5 /nas/content/live/astra-theme-ext/wp-includes/class-wp-customize-widgets.php(714): WP_Customize_Widgets->get_available_widgets()
#6 /nas/content/live/astra-theme-ext/wp-includes/class-wp-hook.php(324): WP_Customize_Widgets->enqueue_scripts('')
#7 /nas/content/live/astra-theme-ext/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#8 /nas/content/live/astra-theme-ext/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 /nas/content/live/astra-theme-ext/wp-admin/customize.php(133): do_action('customize_contr...')
#10 {main}
thrownDescription of the Issue
Inside
beautiful-taxonomy-filters-widget.phpon line 107, the plugin callsin_array()on a variable that is assumed to be an array. However, under certain conditions (such as when the Customizer loads widget controls), WordPress supplies a string or an empty value instead of an array. This results in a PHP 8+ TypeError that prevents:- Access to the Customizer
- Widget screen loading
- Theme customization
This makes it impossible to manage the site’s design while the plugin is active.
At the moment, this error completely blocks the Customizer, which is a critical part of WordPress administration. Any assistance or patch would be greatly appreciated.
Thank you.
You must be logged in to reply to this topic.