• I’m getting an error on this page’s video links (linked page shows it under the Videos section) – “Deprecated: implode(): Passing glue string after array is deprecated.” WordPress version is current, PHP is at 7.4, and all plugins are up-to-date. I’ve tried deactivating all plugins and reverting WP versions back on a staging site, but the error still shows. Any ideas? TIA!

    • This topic was modified 4 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • It could be in your theme. What the message is about (it’s not really an error) is a PHP function called implode which combines the elements of an array by putting the glue parameter between them. In older PHP, the parameters were interchangeable but more recent versions of PHP want the glue to be the first parameter. The places where this was used in core WP were changed several releases ago. Themes and plugins are independent and might not have been changed.

    You can go into the Customizer and preview your site with a different theme to see if it happens still. Or use the Health Check plugin in Troubleshoot mode to disable theme and plugins for your user only, to isolate the culprit. One might have been missed in core WP, so let us know!

    Thread Starter shileyking

    (@shileyking)

    Thanks, Joy. I’ll try that out.

    A little more insight I found – the full text reads:
    Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/wordpress/wp-content/themes/cliburn/category-2017-winners.php on line 177
    Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/wordpress/wp-content/themes/cliburn/category-2017-winners.php on line 181

    Lines 176 – 181 in the template are:

    if (count ($competition) > 0) {
    					echo(implode($competition, ' ') . '<br>');
    				}
    
    				if (count ($round) > 0) {
    					echo(implode($round, ' '));

    I read that changing the parameters in the associated lines has solved this issues for others, I just can’t find what to specifically change the parameters to?

    Put the ' ' as the first parameter instead of the variable. swap the positions of the first and second parameters

    Thread Starter shileyking

    (@shileyking)

    @joyously, that seemed to do the trick! Thank you so much for your help.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Help on Issue – implode(): Passing glue string after array is deprecated’ is closed to new replies.