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_Abstract_Notification_View::get_basic_html()

Get the html for a basic notification


Return Return

(string)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.notification.view.php

	private function get_basic_html() {

		// Setup html classes.
		$classes = array(
			'llms-notification',
		);

		// Setup html attributes.
		$attributes = array(
			'id'      => $this->id,
			'trigger' => $this->trigger_id,
			'type'    => $this->notification->get( 'type' ),
		);

		if ( $this->basic_options['dismissible'] ) {
			$classes[] = 'is-dismissible';
		}
		if ( $this->basic_options['auto_dismiss'] ) {
			$classes[]                  = 'auto-dismiss';
			$attributes['auto-dismiss'] = $this->basic_options['auto_dismiss'];
		}

		$atts = '';
		foreach ( $attributes as $att => $val ) {
			$atts .= sprintf( ' data-%1$s="%2$s"', $att, $val );
		}

		// Get variables.
		$title  = $this->get_title();
		$icon   = ( 'yes' === $this->get_option( 'icon_hide', 'no' ) ) ? '' : $this->get_icon_src();
		$body   = $this->get_body();
		$footer = $this->get_footer();

		ob_start();
		llms_get_template(
			'notifications/basic.php',
			array(
				'atts'        => $atts,
				'body'        => $body,
				'classes'     => implode( ' ', $classes ),
				'date'        => $this->get_date_display( 5 ),
				'dismissible' => $this->basic_options['dismissible'],
				'footer'      => $footer,
				'icon'        => $icon,
				'id'          => $this->id,
				'status'      => $this->notification->get( 'status' ),
				'title'       => $title,
			)
		);
		$html = trim( preg_replace( '/\s+/S', ' ', ob_get_clean() ) );

		return apply_filters( $this->get_filter( 'get_basic_html' ), $html, $this );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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