Can anyone help me to solve this issue?
I’ve changed PHP version form 7.4 to 8 and got this error:
PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /home/iranhfc/maransanat.com/wp-content/themes/maran/lib/utilities.php:63
Stack trace:
#0 /home/iranhfc/maransanat.com/wp-content/themes/maran/lib/utilities.php(63): implode()
#1 /home/iranhfc/maransanat.com/wp-content/themes/maran/lib/framework.php(19): require_once('/home/iranhfc/m...')
#2 /home/iranhfc/maransanat.com/wp-content/themes/maran/lib/framework.php(70): PixflowFramework::Pixflow_Require_Files()
#3 /home/iranhfc/maransanat.com/wp-content/themes/maran/functions.php(97): require_once('/home/iranhfc/m...')
#4 /home/iranhfc/maransanat.com/wp-settings.php(525): include('/home/iranhfc/m...')
#5 /home/iranhfc/maransanat.com/wp-config.php(82): require_once('/home/iranhfc/m...')
#6 /home/iranhfc/maransanat.com/wp-load.php(37): require_once('/home/iranhfc/m...')
#7 /home/iranhfc/maransanat.com/wp-blog-header.php(13): require_once('/home/iranhfc/m...')
#8 /home/iranhfc/maransanat.com/index.php(17): require('/home/iranhfc/m...')
#9 {main}
thrown in /home/iranhfc/maransanat.com/wp-content/themes/maran/lib/utilities.php on line 63
The code:
if(strpos(implode(get_option('active_plugins'),' '),"bookly")>0){
$library_to_include[]='bookly';
}
2
Answers
As @GetSet stated, the arguments in
implode
are the wrong way round.implode() function second parameter must be array.
Deprecated non array data type in second parameter. https://www.php.net/manual/en/migration74.deprecated.php