users and usermeta table

install a fresh wordpress setup on your local machine and then have a look at wp_usersmeta table . It contains meta(additional) information for each user.You (admin) can also make data entry specific to any user by this function update_user_meta() in usermeta table. and retrive the same using get_user_meta() funciton. All fields for all users are … Read more

How to list users by custom field?

To fetch users with certain meta field, you can use WP_User_Query class. Check codex manual for it. So you can create a custom shortcode like this: add_shortcode( ‘listusers’, ‘wpse8170_listusers’ ); function wpse8170_listusers( $atts, $content=”” ) { $atts = shortcode_atts( array( ‘company’ => false ), $atts ); if ( empty( $atts[‘company’] ) ) return $content; $query … Read more

Cannot update user display_name field

This is because there is no meta key named display_name, so if you want to update a single meta value better use update_user_meta instead of wp_update_user, as update_user_meta() will create the meta field if it doesn’t exist. like if ( !empty( $_POST[‘display_name’] ) ) { update_user_meta( $current_user->ID, ‘display_name’, esc_attr( $_POST[‘display_name’] ) ); } Then you … Read more

Lock user information once fields have been filled in

I think this can handle, what you want: Here is the filter documentation http://www.advancedcustomfields.com/resources/filters/acf_update_value/ You can choose whatever filter option you want, but if you use onw of the first two add_filter(‘acf/update_value’, ‘mr_acf_prevent_update’, 10, 3); add_filter(‘acf/update_value/type=text’, ‘mr_acf_prevent_update’, 10, 3); You’ll have to write more conditionals on the callback function. If you use one of these … Read more

Is this code true or not

Best way to find if a code works or not is to actually try it 😉 On the face of it, it doesn’t look like you are trying to handle storing the user ids in an array or any serialized way at all.

When is a user’s meta data table loaded?

This page gives you a typical wordpress load http://codex.wordpress.org/Plugin_API/Action_Reference You can see, the current user is available after the theme is setup but before init. If you are calling these functions within the theme then you will be fine. Otherwise make sure any functions that reference the current user are called using hooks that run … Read more

Plugin will sort users by usermeta

If you want best practices of the options you listed use the user meta table. Adding a column to the users table would be the worst thing you could do – messing with table structure of default WP tables is a no-no. The other two options would fall somewhere in between – with adding your … Read more