(string) Message text * * 'message_type' => (string) Message type * * 'message_is_dismissible' => (boolean) Indicates whether message box is dismissible * * ]. * @since 1.0.0 */ public function __construct( $args = array() ) { $args = wp_parse_args( $args, array( 'message_text' => '', 'message_type' => self::DEFAULT_MESSAGE_TYPE, 'message_is_dismissible' => self::DEFAULT_MESSAGE_IS_DISMISSIBLE, ) ); if ( '' === $args['message_text'] ) { wp_die( __( 'ERROR: Wrong arguments [missing message text argument]', 'wp-data-access' ) ); } $this->message_text = $args['message_text']; $this->message_type = $args['message_type']; $this->message_is_dismissible = true === $args['message_is_dismissible'] ? 'is-dismissible' : ''; switch ( $this->message_type ) { case 'error': $this->message_hint = 'ERROR'; break; case 'action': $this->message_hint = 'ACTION'; $this->message_type = 'notice'; break; default: $this->message_hint = 'INFO'; } $this->message_box_no = ++ self::$message_box_seq; // Give message box a unique number. } /** * Show message box * * @since 1.0.0 */ public function box() { $msgbox_id = 'message_box_' . esc_attr( $this->message_box_no ); global $allowedposttags; ?>

message_hint ); ?>: message_text, $allowedposttags ); ?>

message_box_no ); ?>