Notice_Handler::merge_contents( array $slugs )

Merges the content of a given set of Notice slugs.


Parameters

$slugs

(array) (Required) Array of slugs that will be merged.


Top ↑

Return

(string) $html List with message content from each slug.


Top ↑

Source

File: src/Tickets/Commerce/Notice_Handler.php

	public function merge_contents( array $slugs ) {
		$messages = array_map( [ $this, 'get_message_data' ], $slugs );

		$html[] = '<ul>';
		foreach ( $messages as $message ) {
			$list_class = sanitize_html_class( 'tec-tickets-commerce-notice-item-' . $message['slug'] );
			$html[]     = "<li class='{$list_class}'>";
			$html[]     = $message['content'];
			$html[]     = '</li>';
		}
		$html[] = '</ul>';

		return implode( "\n", $html );
	}

Top ↑

Changelog

Changelog
Version Description
5.2.0 Introduced.