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_passive_popup_upgrades_enabled()

Checks if passive migration for popups should be enabled.


Description Description

This determines if the query load may be potentially too high to run passive migrations on live servers.


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

Return Return

(bool)


Top ↑

Source Source

File: includes/functions/popups/migrations.php

function pum_passive_popup_upgrades_enabled() {
	/** @var int $popup_count */
	static $popup_count;

	if ( defined( 'PUM_DISABLE_PASSIVE_UPGRADES' ) && PUM_DISABLE_PASSIVE_UPGRADES ) {
		return false;
	}

	if ( ! $popup_count ) {
		$popup_count = get_transient( 'pum_popup_count' );

		if ( $popup_count === false ) {
			$popup_count = pum_count_popups( array(
				'post_status'    => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash' ),
			) );

			set_transient( 'pum_popup_count', $popup_count, HOUR_IN_SECONDS * 24 );
		}
	}

	return $popup_count > apply_filters( 'pum_passive_popups_enabled_max_count', 5 );
}


Top ↑

User Contributed Notes User Contributed Notes

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