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_theme_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/themes/migrations.php

function pum_passive_theme_upgrades_enabled() {
	/** @var int $theme_count */
	static $theme_count;

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

	if ( ! $theme_count ) {
		$theme_count = get_transient( 'pum_theme_count' );

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

			set_transient( 'pum_theme_count', $theme_count, MINUTE_IN_SECONDS );
		}
	}

	return pum_is_popup_theme_editor() || $theme_count <= apply_filters( 'pum_passive_themes_enabled_max_count', 10 );
}


Top ↑

User Contributed Notes User Contributed Notes

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