Wordpress 4.7 call_user_func_array() Wordpress 4.7 call_user_func_array() wordpress wordpress

Wordpress 4.7 call_user_func_array()


As @Afzal mentioned this line is problematic:

add_action('plugins_loaded', $this->plugin_update());

We can replicate the error you got with this simple example:

class Test{    public function init()    {        add_action( 'plugins_loaded', $this->plugin_update() );    }    public function plugin_update()    {    }}$obj = new Test;$obj->init();   

The usual way around this problem is to replace:

add_action( 'plugins_loaded', $this->plugin_update() );

with:

add_action( 'plugins_loaded', array( $this, 'plugin_update' ) );