I cannot find the difference between these wp_capabilities values in wp_usermeta

You’ve posted some serialized arrays. The first entry, a:1:{s:13:”administrator”;s:1;} is corrupted – that’s not a valid serialized array. The second entry, a:1:{s:13:”administrator”;s:1:”1″;} looks like this when unserialized: array ( ‘administrator’ => ‘1’, ) The third entry, a:1:{s:13:”administrator”;b:1;} looks like this when unserialized: array ( ‘administrator’ => true, ) In my setup, capabilities are stored like … Read more

Query Nickname rather than Display Name in custom Woocommerce plugin

I had a similar problem and solved it similar to this: add_filter(‘pre_user_display_name’,’default_display_name’); function default_display_name($display_name) { if ( isset( $_POST[‘billing_first_name’] ) ) { $display_name = sanitize_text_field( $_POST[‘billing_first_name’] ); } return $name; } I think, the new woocommerce changes the disyplay_name on every checkout to First_Name Last_Name. With the ‘pre_user_display_name’ you can change your own way.

How can get all users by current user meta?

You can achieve this using get_users function and its meta_key argument as displayed below. $users = get_users(array( ‘meta_key’ => ‘blocking_users’, )); var_dump( $users ); To retrieve it for current user and print it, please use below code. $user_id = get_current_user_id(); $key = ‘blocking_users’; $single = false; $blocking_users = get_user_meta( $user_id, $key, $single ); echo ‘<p>The … Read more