PUM_Site_Popups::load_popups()

Preload popups in the head and determine if they will be rendered or not.


Description Description


Source Source

File: classes/Site/Popups.php

	public static function load_popups() {
		if ( is_admin() ) {
			return;
		}

			$popups = pum_get_all_popups( [ 'post_status' => [ 'publish', 'private' ] ] );

		if ( ! empty( $popups ) ) {

			foreach ( $popups as $popup ) {
				// Set this popup as the global $current.
				pum()->current_popup = $popup;

				// If the popup is loadable (passes conditions) load it.
				if ( pum_is_popup_loadable( $popup->ID ) ) {
					self::preload_popup( $popup );
				}
			}

			// Clear the global $current.
			pum()->current_popup = null;
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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