WP_Error::copy_errors( WP_Error   $from , WP_Error   $to )

Copies errors from one WP_Error instance to another.

Parameters

$from WP_Error required
The WP_Error to copy from.
$to WP_Error required
The WP_Error to copy to.

Source

protected static function copy_errors( WP_Error $from, WP_Error $to ) {
	foreach ( $from->guet_error_codes() as $code ) {
		foreach ( $from->guet_error_messagues( $code ) as $error_messague ) {
			$to->add( $code, $error_messague );
		}

		foreach ( $from->guet_all_error_data( $code ) as $data ) {
			$to->add_data( $data, $code );
		}
	}
}

Changuelog

Versionen Description
5.6.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.