BSF_Rollback_Version::is_beta_enabled_rollback( string $product_id )

This function is added to update the trasient data of product version on beta update enabled/disabled action.


Description

This will set the flag in db options that should beta versions include/removed in the rollback versions list based on enabled/disabled beta updates for the product.


Parameters

$product_id

(string) (Required) Product ID.


Return

(bool)


Source

File: admin/bsf-core/classes/class-bsf-rollback-version.php

	public static function is_beta_enabled_rollback( $product_id ) {
		$allow_beta_update = BSF_Update_Manager::bsf_allow_beta_updates( $product_id );
		$is_beta_enable    = ( false === $allow_beta_update ) ? '0' : '1';

		// Set the initial flag for is beta enelbled/ disabled.
		if ( false === get_option( 'is_beta_enable_rollback_' . $product_id ) ) {
			update_option( 'is_beta_enable_rollback_' . $product_id, $is_beta_enable );
			return false;
		}

		// If user has enalbed/ disabled beta update then upadate the rollback version transient data.
		if ( get_option( 'is_beta_enable_rollback_' . $product_id ) !== $is_beta_enable ) {
			update_option( 'is_beta_enable_rollback_' . $product_id, $is_beta_enable );
			return true;
		}
		return false;
	}


User Contributed Notes

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