WC_Admin_Meta_Boxes::append_to_error_store()publicWC 6.5.0

If additional errors have been added in the current request (ie, via the add_error() method) then they will be added to the persistent error store via the Options API.

Method of the class: WC_Admin_Meta_Boxes{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Meta_Boxes = new WC_Admin_Meta_Boxes();
$WC_Admin_Meta_Boxes->append_to_error_store();

Changelog

Since 6.5.0 Introduced.

WC_Admin_Meta_Boxes::append_to_error_store() code WC 8.7.0

public function append_to_error_store() {
	if ( empty( self::$meta_box_errors ) ) {
		return;
	}

	$existing_errors = get_option( self::ERROR_STORE, array() );
	update_option( self::ERROR_STORE, array_unique( array_merge( $existing_errors, self::$meta_box_errors ) ) );
}