rrennick / shardb

SharDB multi database plugin for WordPress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Register_shutdown_function(): Invalid shutdown callback error

silsbyc opened this issue · comments

After upgrading to WordPress 5.4, we started receiving the following PHP Warning:

PHP Warning: register_shutdown_function(): Invalid shutdown callback 'SharDB::__destruct' passed in [path to WordPress]/wp-content/db.php on line 42

Problem seems to be that WordPress 5.4 wp-db.php removed the lines registering __destruct
https://core.trac.wordpress.org/browser/tags/5.4/src/wp-includes/wp-db.php

Line 607:
register_shutdown_function( array( $this, '__destruct' ) );

Lines 635-645:

 /**
* PHP5 style destructor and will run when database object is destroyed.
	 *
	 * @see wpdb::__construct()
	 * @since 2.0.8
	 * @return true
	 */
	public function __destruct() {
		return true;
	}

Duplicate