Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
2
Indexable
Never
function smuac_connect_multiaccount($parent_account_id, $multiaccount_account_id){

    update_user_meta($multiaccount_account_id,'smuac_account_type', 'multiaccount');
    update_user_meta($multiaccount_account_id,'smuac_account_parent', $parent_account_id);
    
    $current_multiaccounts_list = get_user_meta($parent_account_id,'smuac_multiaccounts_list', true);
    update_user_meta($parent_account_id,'smuac_multiaccounts_list', $current_multiaccounts_list.','.$multiaccount_account_id);
    // the following code sets multiaccount permissions (1 = enabled 0 = not enabled)
    // enable all permissions for multiaccount
    update_user_meta($multiaccount_account_id, 'smuac_account_permission_buy', 1);
    update_user_meta($multiaccount_account_id, 'smuac_account_permission_view_orders', 1); 
    update_user_meta($multiaccount_account_id, 'smuac_account_permission_view_offers', 1); 
    update_user_meta($multiaccount_account_id, 'smuac_account_permission_view_conversations', 1); 
    update_user_meta($multiaccount_account_id, 'smuac_account_permission_view_lists', 1); 
    
}