Updating meta_value in a custom key

The problem is this line $sales = get_user_meta($_POST[‘repID’], ‘sales’); change it to $sales = get_user_meta($_POST[‘repID’], ‘sales’, true); The last parameter says, that you are getting a single value – an array. Otherwise you get an array inside another array. https://developer.wordpress.org/reference/functions/get_post_meta/ EDIT: After reading the comments, as you have the meta in multiple rows, you should … Read more

Updating custom user meta

You can create a similar solution as the one with a form and submit button by adding an onclick event to your button: <button id=”updateMyUserMeta” name=”updateMyUserMeta” onclick=”window.location.href(‘http://example.com?my_custom_user_meta=true’);”>Update</button> Then add this to the functions.php of your theme. /** * Updates the ‘my_custom_user_meta’ field if the * user clicks the ‘Update’ button. */ function update_my_custom_user_meta() { if … Read more

Confusing problem with displaying message recipient metadata

As I see it, you could replace some things in the switch. You need to open and close , tag in the same case rule, do this avoid a lot error. Like this switch( $column ) { case ‘recipientname’ : <div class=”recipentusername”><a href=”https://wordpress.stackexchange.com/questions/243290/<?php echo um_user_profile_url(); ?>” target=”_blank”><?php _e(“”, ‘front-end-pm’); ?> <?php echo implode( $name );?> … Read more

How to get user meta value in wordpress

You can store the user meta in a variable and check if the variable is empty or not, like below- $args = array( ‘role’ => ‘subscriber’, ‘meta_key’ => ‘user_designation’ ); // The Query $user_query = new WP_User_Query($args); // User Loop $u_meta_array = array(); if ( !empty($user_query->results) ) { foreach ( $user_query->results as $user ) { … Read more

Store stripe info as user_meta

Sounds like the $amount variable is empty so it’s not saving. Echo it out to see what’s happening. Make sure the $payment_user_id is an actual WordPress user_id. Wrap your update_user_meta within the if statement. // If charge is successful, store in user meta if (isset($event) && $event->type == “charge.succeeded”) { $amount = $event->data->object->amount / 100; … Read more

Get all data form users and users metakey

WordPress provides a function get_users which display all the user detail and which field you want just pass in the ‘fields’ array. $users = get_users( array( ‘fields’ => array( ‘ID’,’user_login’, ‘user_email’) ) ); foreach ( $blogusers as $user ) { $user_work = get_user_meta( $user->ID, ‘user_work’, true); $user_street = get_user_meta( $user->ID, ‘user_street’, true); $user_state = get_user_meta( … Read more

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