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
PUM_Site_Assets::enqueue_popup_assets( int $popup_id )


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

Parameters Parameters

$popup_id

(Required)


Top ↑

Source Source

File: classes/Site/Assets.php

	public static function enqueue_popup_assets( $popup_id = 0 ) {
		/**
		 * TODO Replace this with a pum_get_popup function after new Popup model is in place.
		 *
		 * $popup = pum_get_popup( $popup_id );
		 *
		 * if ( ! pum_is_popup( $popup ) ) {
		 *        return;
		 * }
		 */

		$popup = new PUM_Popup( $popup_id );

		wp_enqueue_script( 'popup-maker-site' );
		wp_enqueue_style( 'popup-maker-site' );

		if ( $popup->mobile_disabled() || $popup->tablet_disabled() ) {
			wp_enqueue_script( 'mobile-detect' );
		}

		/**
		 * TODO Implement this in core $popup model & advanced targeting conditions.
		 *
		 * if ( $popup->has_condition( array(
		 *    'device_is_mobile',
		 *    'device_is_phone',
		 *    'device_is_tablet',
		 *    'device_is_brand',
		 * ) ) ) {
		 *    self::enqueue_script( 'mobile-detect' );
		 * }
		 */
	}

Top ↑

User Contributed Notes User Contributed Notes

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