Need help getting a certain value out of a multi dimensional array

The reason you get the “First” Array is that you don’t use the “single” option of the get_user_meta function. Try this: $arr = get_user_meta($user->ID, ‘wpcf-team-experience-member-type’,true); $options = array(); if(is_array($arr)){ foreach($arr as $key => $value){ foreach($value as $arrvalue){ $options[] = $arrvalue; } } } var_dump($options); This should dump all the options that maybe are in there. … Read more

Redirecting to an external URL

Use is_user_logged_in() to show link only or logged in users. And use the_author_meta() to get url to google drive. Like this inside The Loop: <?php if(is_user_logged_in()): ?> <a href=”https://wordpress.stackexchange.com/questions/201838/<?php the_author_meta(“google_drive_url’) ?>”>Click to open Google Drive</a> <?php endif; ?>

How do I change the user via SQL?

You probably haven’t changed the display name, which is probably what is being displayed. “nicename” is used for the author’s posts page url and not for display. UPDATE wp_users SET display_name = replace(display_name, @old_user, @new_user);

Store extra user values permanently

update_user_meta will store the value permanently, as you are expecting. How ever in your case, there are multiple scenerio where you can loose those data. Thats the reason you are seeing empty result. First check when are you running the update_user_meta. Is it on every page request. If so then $_POST[‘the new value’] shouldn’t be … Read more

Querying users by meta value and getting a strange answer

It looks like you’re using a custom meta field but searching default meta attributes. https://codex.wordpress.org/Class_Reference/WP_User_Query WP_User_Query might be a more robust solution. So it would look like something like : $args = array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( array( ‘key’ => ‘mps_finaldate’, ‘value’ => ”, ‘compare’ => ‘!=’ ), array( ‘key’ => ‘mps_finaldate’, … Read more

UserMeta Changes Meta Value for Post ID

I believe your issue is related to getting the correct post object on your single post page. From what I can detect from your question is that $post does not contain the post object which you expect. You must remember, $post is one of those very crappy globals which WordPress uses to store the current … Read more