Automator_Error_Messages::get( null|string $error_key = null, null|string $additional_information = '' )

Get the message associated with the error key


Parameters Parameters

$additional_information

(null|string) (Optional)

Default value: ''

$error_key

(null|string) (Optional)

Default value: null


Top ↑

Return Return

(null|string)


Source Source

File: src/core/lib/utilities/error/class-automator-error-messages.php

	public function get( $error_key = null, $additional_information = '' ) {

		/**
		 * Filters all error messages before a specific error message is set
		 */
		$error_messages = apply_filters( 'automator_error_messages', $this->error_messages );
		if ( ! isset( $error_messages[ $error_key ] ) ) {
			return __( 'No message', 'uncanny-automator' );
		}
		$error_message = $error_messages[ $error_key ] . $additional_information;

		/**
		 * Filters the specific error message
		 */
		return apply_filters( 'automator_error_message', $error_message, $error_key, $additional_information );
	}