WordPress at Your Fingertips
function is not described

WC_Customer_Download_Data_Store::create_from_data() public WC 1.0

Create download permission for a user, from an array of data.

{} It's a method of the class: WC_Customer_Download_Data_Store{}


null. Nothing.


$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store();
$WC_Customer_Download_Data_Store->create_from_data( $data );
$data(array) (required)
Data to create the permission for.

Code of WC_Customer_Download_Data_Store::create_from_data() WC 5.6.0

public function create_from_data( $data ) {
	$data = array_intersect_key( $data, array_flip( self::DOWNLOAD_PERMISSION_DB_FIELDS ) );

	$id = $this->insert_new_download_permission( $data );

	do_action( 'woocommerce_grant_product_download_access', $data );

	return $id;