Enable login by role both on frontend and backend

This commit is contained in:
Almira Krdzic
2018-10-22 09:47:48 +02:00
parent 87f408125d
commit 21fafc5a43
20 changed files with 618 additions and 367 deletions

View File

@@ -226,7 +226,7 @@ class Wiaas_Admin_Organization {
// get current user
$current_user = wp_get_current_user();
update_user_meta($current_user->ID, '_wiaas_current_user_admin_role', $role->name);
update_user_meta($current_user->ID, '_wiaas_admin_role', $role->name);
// switch user role
$current_user->set_role($role->name);

View File

@@ -107,10 +107,6 @@ class Wiaas_Admin_Product {
$value = get_field('_wiaas_product_country', $post_id, true);
$type = get_field('_wiaas_product_type', $post_id, true);
error_log($status);
error_log($value);
if (!empty($value) && $status === '_wiaas_no_country' ) {
wp_set_object_terms($post_id, $value, 'product_country', true);

View File

@@ -148,6 +148,8 @@ class Wiaas_Admin_Package_Pricing {
$pricing_rules,
$commission,
$max_cost_margin);
Wiaas_Access_Management::maybe_handle_product_access($package_id, get_post($package_id));
}
}