public function admin_notices() {
		$afterKeyAdded = get_option( $this->option );

		if ( empty( $afterKeyAdded ) ) {
			return;
		}

		switch( $afterKeyAdded ) {
			case 'success':
				echo '<div class="notice notice-success is-dismissible bglib-key-added"><p>' .
					esc_html( 'Your new BoldGrid Connect Key has been successfully added!', 'boldgrid-library' ) .
					'</p></div>';
				break;
			case 'fail':
				echo '<div class="notice notice-error is-dismissible bglib-key-added"><p>' .
					esc_html( 'An unknown error occurred adding your new BoldGrid Connect Key.', 'boldgrid-library' ) .
					'</p></div>';
				break;
		}

		delete_option( $this->option );
	}
public function admin_notices() {
		$afterKeyAdded = get_option( $this->option );

		if ( empty( $afterKeyAdded ) ) {
			return;
		}

		switch( $afterKeyAdded ) {
			case 'success':
				echo '<div class="notice notice-success is-dismissible bglib-key-added"><p>' .
					esc_html( 'Your new BoldGrid Connect Key has been successfully added!', 'boldgrid-library' ) .
					'</p></div>';
				break;
			case 'fail':
				echo '<div class="notice notice-error is-dismissible bglib-key-added"><p>' .
					esc_html( 'An unknown error occurred adding your new BoldGrid Connect Key.', 'boldgrid-library' ) .
					'</p></div>';
				break;
		}

		delete_option( $this->option );
	}
public function admin_notices ( ) { $ afterKeyAdded = get_option ( $ this -> option ) ; if ( empty ( $ afterKeyAdded ) ) { return ; } switch ( $ afterKeyAdded ) { case 'success' : echo '<div class="notice notice-success is-dismissible bglib-key-added"><p>' . esc_html ( 'Your new BoldGrid Connect Key has been successfully added!' , 'boldgrid-library' ) . '</p></div>' ; break ; case 'fail' : echo '<div class="notice notice-error is-dismissible bglib-key-added"><p>' . esc_html ( 'An unknown error occurred adding your new BoldGrid Connect Key.' , 'boldgrid-library' ) . '</p></div>' ; break ; } delete_option ( $ this -> option ) ; }
Admin notices.

If the user's key was successfully added, we need to show an admin notice.

@since 1.8.0
Admin notices .