HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.1.1k
System: Linux tam.zee-supreme-vps.net 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64
User: adltc (1070)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/adltc/public_html/wp-content/plugins/jet-engine/includes/traits/notices.php
<?php
/**
 * Trait to use bounded parent -> child data class notices system
 */

trait Jet_Engine_Notices_Trait {

	/**
	 * Notices list
	 *
	 * @var array
	 */
	public $notices = array();

	/**
	 * Add notice to stack
	 *
	 * @param string $type    [description]
	 * @param [type] $message [description]
	 */
	public function add_notice( $type = 'error', $message = null ) {
		$this->notices[] = array(
			'type'    => $type,
			'message' => $message,
		);
	}

	/**
	 * Add notice to stack
	 *
	 * @param string $type    [description]
	 * @param [type] $message [description]
	 */
	public function get_notices() {
		return $this->notices;
	}

	/**
	 * Print stored notices
	 *
	 * @return [type] [description]
	 */
	public function print_notices() {

		if ( empty( $this->notices ) ) {
			return;
		}

		?>
		<div class="cpt-notices"><?php
			foreach ( $this->notices as $notice ) {
				printf( '<div class="notice notice-%1$s"><p>%2$s</p></div>', $notice['type'], $notice['message'] );
			}
		?></div>
		<?php

	}

}