What is best for saving lot of extra detail of user?

You can store multiple pieces of data within a single field by passing an array rather than a string: $user_data = array( ‘favorite_color’ => ‘blue’, ‘favorite_animal’ => ‘cat’, ‘favorite_city’ => ‘paris’ ); update_user_meta( $user_id, ‘user_data’, $user_data ); WordPress will serialize this data for you on save, and unserialize back into an array when it is … Read more

Get custom_user meta value and add entry

You need to pass get_user_meta a third parameter to prevent it from returning an array. That is where the mistake is, not with the add/update functions. $invoice_meta = get_user_meta( $_GET[‘id’], ‘invoices’, true); You will need to clean up any data already in the database or the existing nested arrays will still cause trouble.

Matching usermeta at registration to categories of content

Are you looking for this? function convertInterestCategory() { $interest_categories = array( ‘interest_disaster’, ‘interest_animals’, ‘interest_women’, ‘interest_seniors’, ‘interest_hunger_health’, ‘interest_education’, ‘interest_environment’, ‘interest_arts_culture’, ‘interest_children_youth’, ‘interest_other’, ‘interest_mentoring’, ‘interest_poverty_urban’ ); $current_user = wp_get_current_user(); $user_values = get_user_meta( $current_user->ID ); foreach ( $interest_categories as $interest_category ) { if ( isset( $user_values[$interest_category][0] ) ) echo $user_values[$interest_category][0]; } }

Display all existing members

You can use get_users(). $args = array( ‘fields’ => ‘all_with_meta’, ); $users = get_users( $args ); foreach( $users as $user ) { // your display code here var_dump( $user ); // so you can see what’s in $user } all_with_meta will get the user and all the associated meta, if I’m reading the Codex page … Read more

update_user_meta on registration but only for default role type

Here is what you need to do: function set_user_rcp_default_subscriber($user_id) { $user = new WP_User( $user_id ); foreach( $user->roles as $role ) { if ( $role === ‘subscriber’ ) { update_user_meta( $user_id, ‘wp_user_level’, ‘0’ ); update_user_meta( $user_id, ‘rcp_subscription_level’, ‘1’ ); update_user_meta( $user_id, ‘rcp_status’, ‘active’ ); update_user_meta( $user_id, ‘rcp_expiration’, ‘2014-06-30’ ); } } } add_action(“user_register”, “set_user_rcp_default_subscriber”, 10, … Read more

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