has('blog_id') ) { switch_to_blog( $this->get('blog_id') ); } // bail early if no upgrade avaiable if( !acf_has_upgrade() ) { return new WP_Error( 'upgrade_error', __('No updates available.', 'acf') ); } // listen for output ob_start(); // run upgrades acf_upgrade_all(); // store output $error = ob_get_clean(); // return error if output if( $error ) { return new WP_Error( 'upgrade_error', $error ); } // return return true; } } acf_new_instance('ACF_Ajax_Upgrade'); endif; // class_exists check ?>