This commit is contained in:
Almira Krdzic
2018-10-20 00:42:03 +02:00
parent 88c5ae5eb1
commit 95318ff1c4
2 changed files with 2 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ class Wiaas_WC_Package_API_Integration {
public static function init() {
// add_filter('woocommerce_rest_product_object_query', array(__CLASS__, 'filter_packages'), 10, 2);
add_filter('woocommerce_rest_product_object_query', array(__CLASS__, 'filter_packages'), 10, 2);
add_filter('rest_dispatch_request', array(__CLASS__, 'validate_package_search_request'), 10, 4);
}

View File

@@ -55,8 +55,6 @@ class Wiaas_Authentication {
return $user_id;
}
return $user_id;
$user = new WP_User($user_id);
if (empty($user->roles)) {
@@ -83,7 +81,7 @@ class Wiaas_Authentication {
public static function authenticate_user_on_login($user) {
// do nothing if there is an error already,
// user is super admin
if (is_wp_error($user) || $user->ID === 1) {
if (is_wp_error($user) || $user->ID === self::SUPER_ADMIN_USER_ID) {
return $user;
}
@@ -115,8 +113,6 @@ class Wiaas_Authentication {
if ($user_id !== 0 && $user_id !== self::SUPER_ADMIN_USER_ID && $meta_key === $wpdb->get_blog_prefix() . 'capabilities') {
return array( array( 'customer' => true ) );
// import organization functions (during user authentication it is not yet loaded)
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';