Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_Profile::merge_llms_fields_errors( WP_Error $errors )

Merge llms fields errors into the passed WP_Error


Parameters Parameters

$errors

(WP_Error) (Required) Instance of WP_Error, passed by reference.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/class-llms-admin-profile.php

	private function merge_llms_fields_errors( &$errors ) {

		foreach ( $this->errors->get_error_codes() as $code ) {
			foreach ( $this->errors->get_error_messages( $code ) as $error_message ) {
				$errors->add(
					$code,
					sprintf(
						// Translators: %1$s = Opening strong tag; %2$s = Closing strong tag; %3$s = The error message.
						esc_html__( '%1$sError%2$s: %3$s', 'lifterlms' ),
						'<strong>',
						'</strong>',
						$error_message
					)
				);
			}

			// `WP_Error::get_all_error_data()` has been introduced in WP 5.6.0.
			$error_data = method_exists( $this->errors, 'get_all_error_data' ) ?
					$this->errors->get_all_error_data( $code ) : $this->errors->get_error_data( $code );

			foreach ( $error_data as $data ) {
				$errors->add_data( $data, $code );
			}
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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