Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Onboarding::tips_alert( array $alerts )

Adds a ‘tip’ alert occasionally inside PM’s admin area


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Parameters Parameters

$alerts

(Required) The alerts currently in the alert system.


Top ↑

Return Return

(array) Alerts for the alert system.


Top ↑

Source Source

File: classes/Admin/Onboarding.php

	public static function tips_alert( $alerts ) {
		if ( ! self::should_show_tip() ) {
			return $alerts;
		}

		$tip = self::get_random_tip();

		$alerts[] = array(
			'code'        => 'pum_tip_alert',
			'type'        => 'info',
			'message'     => $tip['msg'],
			'priority'    => 10,
			'dismissible' => '1 month',
			'global'      => false,
			'actions'     => array(
				array(
					'primary' => true,
					'type'    => 'link',
					'action'  => '',
					'href'    => $tip['link'],
					'text'    => __( 'Learn more', 'popup-maker' ),
				),
				array(
					'primary' => false,
					'type'    => 'action',
					'action'  => 'dismiss',
					'text'    => __( 'Dismiss', 'popup-maker' ),
				),
				array(
					'primary' => false,
					'type'    => 'action',
					'action'  => 'disable_tips',
					'text'    => __( 'Turn off these occasional tips', 'popup-maker' ),
				),
			),
		);

		return $alerts;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.13.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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