WC_Customer_Download_Data_Store::create_from_data()
Create download permission for a user, from an array of data.
Method of the class: WC_Customer_Download_Data_Store{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$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.
WC_Customer_Download_Data_Store::create_from_data() WC Customer Download Data Store::create from data code WC 9.4.2
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; }