Same error here, though mine says Fatal, same line.
I tried using the Troubleshooting Mode to isolate it to just this one plugin, to make sure there were no other plugins interfering, and had the same problem.
While we do have a few custom post types defined (okay, 18, but not my decision!) and a few custom taxonomies, those were not active during the Troubleshooting Mode, so it is something to do with line 527.
if ( in_array( $post_type -> name, admin_search_setting( 'post_types' ) ) ) {
So I changed it to this:
if (is_array(admin_search_setting( 'post_types' ) ) ) {
if ( in_array( $post_type -> name, admin_search_setting( 'post_types' ) ) ) {
echo " checked";
}
}
I suspect that maybe the settings are not initialized yet, because by adding an if/then wrapper to make sure the admin_search_setting() function is in fact an array, the error moves on down the line to #552
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /wp-content/plugins/admin-search/settings.php:552
So, wrapping THAT error line with an if/then statement:
if (is_array(admin_search_setting( 'taxonomies' ) ) ) {
if ( in_array( $taxonomy -> name, admin_search_setting( 'taxonomies' ) ) ) {
echo " checked";
}
}
So I think if you patch it up this way, it works.
I have just tested these corrections in settings.php and they work like a charm. The plugin is now up and running. Thanks a lot.
-
This reply was modified 3 years, 7 months ago by
Aris. Reason: typo
-
This reply was modified 3 years, 7 months ago by
Aris.
Hi jhayghost, Maxime, bkjproductions and Aris,
Thank you for your patience and solutions in the meantime. Version 1.2.2 resolves this issue.
Andrew