get_users is expecting unserialized meta_value

In your original code, you’re not passing an operator to meta_compare. Note that get_users() does not define a default operator. Try using ‘=’: $args = array( ‘meta_key’ => ‘custom-usermeta’, ‘meta_value’ => $cat_id, ‘meta_compare’ => ‘=’ ); $users = get_users( $args ); As a diagnostic, you might make sure that the problem isn’t the saving/querying by … Read more

Grouping users under parent user

Roles First of all you need to register the 2 roles, look at add_role. When you register the role, you are free to assign any capability you want. Only be careful to add the roles when your theme / plugin is activated and possibly remove them (see remove_role) when it is disabled. Meta Data You … Read more

How to display custom user meta from registration in backend?

Actually I found this to be more strait forward and simpler: //add columns to User panel list page function add_user_columns($column) { $column[‘address’] = ‘Street Address’; $column[‘zipcode’] = ‘Zip Code’; return $column; } add_filter( ‘manage_users_columns’, ‘add_user_columns’ ); //add the data function add_user_column_data( $val, $column_name, $user_id ) { $user = get_userdata($user_id); switch ($column_name) { case ‘address’ : … Read more

wp_get_current_user always returns 0

wp_get_current_user() is actually just a wrapper for $current_user and get_currentuserinfo(), so you can use both. It’s important, though, to only call it on or after the init hook. Calling it before will only return 0, as you’ve experienced.

Problem storing arrays with update_user_meta

Haven’t used the function for quite a time, but i guess your problem is that you are pushing an array into an array. So check if intval($_GET[‘auction’]) is an array: echo ‘<pre>’; print_r(intval($_GET[‘auction’])); echo ‘</pre>’; Edit #1: You maybe need to get the value from that array and then array_push it. So maybe something like … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)