test
This commit is contained in:
@@ -16,7 +16,7 @@ class Wiaas_WC_Package_API_Integration {
|
|||||||
|
|
||||||
public static function init() {
|
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);
|
add_filter('rest_dispatch_request', array(__CLASS__, 'validate_package_search_request'), 10, 4);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ class Wiaas_Authentication {
|
|||||||
return $user_id;
|
return $user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $user_id;
|
|
||||||
|
|
||||||
$user = new WP_User($user_id);
|
$user = new WP_User($user_id);
|
||||||
|
|
||||||
if (empty($user->roles)) {
|
if (empty($user->roles)) {
|
||||||
@@ -83,7 +81,7 @@ class Wiaas_Authentication {
|
|||||||
public static function authenticate_user_on_login($user) {
|
public static function authenticate_user_on_login($user) {
|
||||||
// do nothing if there is an error already,
|
// do nothing if there is an error already,
|
||||||
// user is super admin
|
// 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;
|
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') {
|
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)
|
// import organization functions (during user authentication it is not yet loaded)
|
||||||
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';
|
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user