PUM_Upgrade_v1_7_Popups

Implements a batch processor for migrating existing popups to new data structure.


Description Description

See also See also


    Warning: preg_match(): Compilation failed: invalid range in character class at offset 24 in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/formatting.php on line 207
  • PUM_Abstract_Upgrade_Popups

Top ↑

Source Source

File: includes/batch/upgrade/class-upgrade-v1_7-popups.php

class PUM_Upgrade_v1_7_Popups extends PUM_Abstract_Upgrade_Popups {

	/**
	 * Batch process ID.
	 *
	 * @var    string
	 */
	public $batch_id = 'core-v1_7-popups';

	/**
	 * Process needed upgrades on each popup.
	 *
	 * @param int $popup_id
	 */
	public function process_popup( $popup_id = 0 ) {

		$popup = pum_get_popup( $popup_id );

		/**
		 * If the popup is already updated, return early.
		 */
		if ( $popup->data_version < 3 ) {

			/**
			 * Processes the popups data through a migration routine.
			 *
			 * $popup is passed by reference.
			 */
			pum_popup_migration_2( $popup );

			/**
			 * Update the popups data version.
			 */
			$popup->update_meta( 'data_version', 3 );
		}
	}

}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.


Top ↑

Methods Methods


Top ↑

User Contributed Notes User Contributed Notes

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