src/Modules/Notification.php
public static function get_notification_html( $notification_details ) {
		$default              = [
			'id'      => '',
			'heading' => '',
			'message' => '',
			'ctas'    => [
				'confirm' => [
					'link' => '#',
					'text' => '',
				],
				'cancel'  => [
					'link' => '#',
					'text' => '',
				],
			],
		];
		$notification_details = wp_parse_args( $notification_details, $default );

		$notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';

		if ( ! empty( $notification_details['heading'] ) ) {
			$notification_html .= sprintf( '<h4>%s</h4>', wp_kses_post( $notification_details['heading'] ) );
		}
		if ( ! empty( $notification_details['message'] ) ) {
			$notification_html .= wp_kses_post( $notification_details['message'] );
		}
		$notification_html .= '<div class="actions">';

		if ( ! empty( $notification_details['ctas']['confirm']['text'] ) ) {
			$notification_html .= sprintf(
				'<a href="%s" target="_blank" class=" button button-primary %s" data-confirm="yes" >%s</a>',
				esc_url( $notification_details['ctas']['confirm']['link'] ),
				esc_attr( $notification_details['id'] . '_confirm' ),
				wp_kses_post( $notification_details['ctas']['confirm']['text'] )
			);
		}

		if ( ! empty( $notification_details['ctas']['cancel']['text'] ) ) {
			$notification_html .= sprintf(
				'<a href="%s" class=" button %s" data-confirm="no">%s</a>',
				esc_url( $notification_details['ctas']['cancel']['link'] ),
				esc_attr( $notification_details['id'] ) . '_cancel',
				wp_kses_post( $notification_details['ctas']['cancel']['text'] )
			);
		}

		$notification_html .= '</div>';
		$notification_html .= '	</div>';
		$notification_html .= '	</div>';

		return $notification_html;
	}
public static function get_notification_html( $notification_details ) {
		$default              = [
			'id'      => '',
			'heading' => '',
			'message' => '',
			'ctas'    => [
				'confirm' => [
					'link' => '#',
					'text' => '',
				],
				'cancel'  => [
					'link' => '#',
					'text' => '',
				],
			],
		];
		$notification_details = wp_parse_args( $notification_details, $default );

		$notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr( $notification_details['id'] ) . '" id="' . esc_attr( $notification_details['id'] ) . '-notification"> <div class="themeisle-sdk-notification-box">';

		if ( ! empty( $notification_details['heading'] ) ) {
			$notification_html .= sprintf( '<h4>%s</h4>', wp_kses_post( $notification_details['heading'] ) );
		}
		if ( ! empty( $notification_details['message'] ) ) {
			$notification_html .= wp_kses_post( $notification_details['message'] );
		}
		$notification_html .= '<div class="actions">';

		if ( ! empty( $notification_details['ctas']['confirm']['text'] ) ) {
			$notification_html .= sprintf(
				'<a href="%s" target="_blank" class=" button button-primary %s" data-confirm="yes" >%s</a>',
				esc_url( $notification_details['ctas']['confirm']['link'] ),
				esc_attr( $notification_details['id'] . '_confirm' ),
				wp_kses_post( $notification_details['ctas']['confirm']['text'] )
			);
		}

		if ( ! empty( $notification_details['ctas']['cancel']['text'] ) ) {
			$notification_html .= sprintf(
				'<a href="%s" class=" button %s" data-confirm="no">%s</a>',
				esc_url( $notification_details['ctas']['cancel']['link'] ),
				esc_attr( $notification_details['id'] ) . '_cancel',
				wp_kses_post( $notification_details['ctas']['cancel']['text'] )
			);
		}

		$notification_html .= '</div>';
		$notification_html .= '	</div>';
		$notification_html .= '	</div>';

		return $notification_html;
	}
public static function get_notification_html ( $ notification_details ) { $ default = [ 'id' => '' , 'heading' => '' , 'message' => '' , 'ctas' => [ 'confirm' => [ 'link' => '#' , 'text' => '' , ] , 'cancel' => [ 'link' => '#' , 'text' => '' , ] , ] , ] ; $ notification_details = wp_parse_args ( $ notification_details , $ default ) ; $ notification_html = '<div class="notice notice-success is-dismissible themeisle-sdk-notice" data-notification-id="' . esc_attr ( $ notification_details [ 'id' ] ) . '" id="' . esc_attr ( $ notification_details [ 'id' ] ) . '-notification"> <div class="themeisle-sdk-notification-box">' ; if ( ! empty ( $ notification_details [ 'heading' ] ) ) { $ notification_html .= sprintf ( '<h4>%s</h4>' , wp_kses_post ( $ notification_details [ 'heading' ] ) ) ; } if ( ! empty ( $ notification_details [ 'message' ] ) ) { $ notification_html .= wp_kses_post ( $ notification_details [ 'message' ] ) ; } $ notification_html .= '<div class="actions">' ; if ( ! empty ( $ notification_details [ 'ctas' ] [ 'confirm' ] [ 'text' ] ) ) { $ notification_html .= sprintf ( '<a href="%s" target="_blank" class=" button button-primary %s" data-confirm="yes" >%s</a>' , esc_url ( $ notification_details [ 'ctas' ] [ 'confirm' ] [ 'link' ] ) , esc_attr ( $ notification_details [ 'id' ] . '_confirm' ) , wp_kses_post ( $ notification_details [ 'ctas' ] [ 'confirm' ] [ 'text' ] ) ) ; } if ( ! empty ( $ notification_details [ 'ctas' ] [ 'cancel' ] [ 'text' ] ) ) { $ notification_html .= sprintf ( '<a href="%s" class=" button %s" data-confirm="no">%s</a>' , esc_url ( $ notification_details [ 'ctas' ] [ 'cancel' ] [ 'link' ] ) , esc_attr ( $ notification_details [ 'id' ] ) . '_cancel' , wp_kses_post ( $ notification_details [ 'ctas' ] [ 'cancel' ] [ 'text' ] ) ) ; } $ notification_html .= '</div>' ; $ notification_html .= '	</div>' ; $ notification_html .= '	</div>' ; return $ notification_html ; }
Get notification html.

@param array $notification_details Notification details.

@return string Html for notice.
Get notification html .