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_Utils_Upgrades::needs_v1_8_theme_upgrade()


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

Return Return

(bool)


Top ↑

Source Source

File: classes/Utils/Upgrades.php

	public function needs_v1_8_theme_upgrade() {
		if ( pum_has_completed_upgrade( 'core-v1_8-themes' ) ) {
			return false;
		}

		$needs_upgrade = get_transient( 'pum_needs_1_8_theme_upgrades' );

		if ( $needs_upgrade === false ) {
			$query = new WP_Query( array(
				'post_type'  => 'popup_theme',
				'post_status' => 'any',
				'fields'     => 'ids',
				'meta_query' => array(
					'relation' => 'OR',
					array(
						'key'     => 'popup_theme_data_version',
						'compare' => 'NOT EXISTS',
						'value'   => 'deprecated', // Here for WP 3.9 or less.
					),
					array(
						'key'     => 'popup_theme_data_version',
						'compare' => '<',
						'value'   => 3,
					),
				),
			) );

			$needs_upgrade = $query->post_count;
		}

		if ( $needs_upgrade <= 0 ) {
			pum_set_upgrade_complete( 'core-v1_8-themes' );
			delete_transient( 'pum_needs_1_8_theme_upgrades' );

			return false;
		}

		set_transient( 'pum_needs_1_8_theme_upgrades', $needs_upgrade );

		return (bool) $needs_upgrade;

	}


Top ↑

User Contributed Notes User Contributed Notes

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