test
This commit is contained in:
@@ -13,16 +13,16 @@ class Wiaas_Authentication {
|
||||
|
||||
public static function init() {
|
||||
// authenticate current user
|
||||
add_action('determine_current_user', array(__CLASS__, 'authenticate_current_user'), 999);
|
||||
# add_action('determine_current_user', array(__CLASS__, 'authenticate_current_user'), 999);
|
||||
|
||||
// authenticates user on login
|
||||
add_filter( 'authenticate', array( __CLASS__, 'authenticate_user_on_login' ), 999, 3);
|
||||
# add_filter( 'authenticate', array( __CLASS__, 'authenticate_user_on_login' ), 999, 3);
|
||||
|
||||
// retrieve preferred user role for user
|
||||
add_filter('get_user_metadata', array(__CLASS__, 'maybe_filter_user_roles'), 10, 3);
|
||||
|
||||
// redirect to dashboard after login
|
||||
add_filter( 'login_redirect', array( __CLASS__, 'login_redirect' ) );
|
||||
# add_filter( 'login_redirect', array( __CLASS__, 'login_redirect' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,6 +113,8 @@ class Wiaas_Authentication {
|
||||
|
||||
if ($user_id !== 0 && $user_id !== self::SUPER_ADMIN_USER_ID && $meta_key === $wpdb->get_blog_prefix() . 'capabilities') {
|
||||
|
||||
return array( array( 'administrator' => true ) );
|
||||
|
||||
// import organization functions (during user authentication it is not yet loaded)
|
||||
require_once dirname( __FILE__ ) . '/user/wiaas-organization-functions.php';
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ class Wiaas_Countries {
|
||||
register_taxonomy( 'product_country', array( 'product' ), $args );
|
||||
|
||||
foreach (self::$available_countries as $available_country) {
|
||||
wp_insert_term($available_country['name'], 'product_country');
|
||||
wp_update_term($available_country['name'], 'product_country');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -303,11 +303,11 @@ class Wiaas_Document {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (self::$available_doc_types as $key => $available_doc_type) {
|
||||
wp_insert_term($available_doc_type['name'], 'wpdmcategory', array(
|
||||
'slug' => $key
|
||||
));
|
||||
}
|
||||
// foreach (self::$available_doc_types as $key => $available_doc_type) {
|
||||
// wp_insert_term($available_doc_type['name'], 'wpdmcategory', array(
|
||||
// 'slug' => $key
|
||||
// ));
|
||||
// }
|
||||
}
|
||||
|
||||
public static function register_wiaas_document() {
|
||||
@@ -400,11 +400,11 @@ class Wiaas_Document {
|
||||
register_taxonomy( 'wiaas_doc_type', array( 'wiaas_doc' ), $args );
|
||||
|
||||
foreach (self::$available_doc_types as $key => $available_doc_type) {
|
||||
if (! has_term($available_doc_type['name'], 'wiaas_doc_type')) {
|
||||
wp_insert_term($available_doc_type['name'], 'wiaas_doc_type', array(
|
||||
'slug' => $key
|
||||
));
|
||||
}
|
||||
// if (! has_term($available_doc_type['name'], 'wiaas_doc_type')) {
|
||||
// wp_insert_term($available_doc_type['name'], 'wiaas_doc_type', array(
|
||||
// 'slug' => $key
|
||||
// ));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class Wiaas_Package_Type {
|
||||
$types = apply_filters('wiaas_package_types', array('standard'));
|
||||
|
||||
foreach ($types as $type) {
|
||||
wp_insert_term($type, 'package_type');
|
||||
wp_update_term($type, 'package_type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Wiaas_Product_Category {
|
||||
|
||||
foreach (self::$available_product_categories as $key => $available_product_category) {
|
||||
if (! has_term_meta($key)) {
|
||||
wp_insert_term($key, 'product_cat');
|
||||
wp_update_term($key, 'product_cat');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,9 +73,7 @@ class Wiaas_Measurement_Units {
|
||||
register_taxonomy('wiaas_units', array('product'), $args);
|
||||
|
||||
foreach (self::$available_units as $available_unit) {
|
||||
if (!term_exists($available_unit, 'wiaas_units')) {
|
||||
wp_insert_term($available_unit['unit'], 'wiaas_units');
|
||||
}
|
||||
wp_update_term($available_unit['unit'], 'wiaas_units');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user