BSF_License_Manager::bsf_update_product_info( int $product_id, array $args )

BSF Update product Info.


Description


Parameters

$product_id

(int) (Required) Product ID.

$args

(array) (Required) Arguments.


Source

File: admin/bsf-core/class-bsf-license-manager.php

		public function bsf_update_product_info( $product_id, $args ) {
			$brainstrom_products = get_option( 'brainstrom_products', array() );

			foreach ( $brainstrom_products as $type => $products ) {

				foreach ( $products as $id => $product ) {

					if ( $id == $product_id ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
						foreach ( $args as $key => $value ) {
							$brainstrom_products[ $type ][ $id ][ $key ] = $value;
							do_action( "bsf_product_update_{$value}", $product_id, $value );
						}
					}
				}
			}

			update_option( 'brainstrom_products', $brainstrom_products );
		}


User Contributed Notes

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