shortcode display metainformation as linked image

@WebElaine is correct. I had to use the wp_get_current_user(); and remove global. This is what worked for me function download_to_wallet() { $current_user = wp_get_current_user(); // get current user’s information $qr_url = $current_user->qrbase_code_pass_url; return ‘<a href=”‘. $qr_url . ‘”><img class=”qr_download” src=”https://example.com/wp-content/uploads/2018/08/add-to-apple-wallet-logo.png” style=”width:200px;”></a>’; }

Get field in readable word

(Updated/new answer) How to make it show “United States (US)” instead, on the frontend, in a shortcode? First off, you got united-states (the country slug/key) instead of United States (US) (the country name) because your extrainfo_save_extra_user_profile_fields() function is saving the country slug/key instead of the country name. That’s not a problem, and I’d do the … Read more

using custom meta user data to run queries in WordPress

wp_get_current_user() does not return all the data for the user, you should try using get_user_meta(). Try as below $company = get_user_meta($current_user->ID,’company’); $mf_group = get_user_meta($current_user->ID,’mf_group’); and in your post loop changes this two lines as below ‘company’ => $company[0], ‘mf_group’ => $mf_group[0], Hope this helps.

How to set a user meta key value based on another user meta key value

You would need to use a meta query for this. $meta_query_args = array( array( ‘key’ => ‘access_code’, ‘value’ => ‘abc’, ‘compare’ => ‘=’ ) ); $args = array( ‘meta_query’ => $meta_query_args ); $users = get_users( $args ); // User Loop foreach ( $users as $user ) { update_user_meta( $user->ID, ‘association’, ‘XYZ Corporation’); }

get_the_author_meta i want to write in a loop

Your loop rewrite is good so far, yet you can make it better: <?php $at_social_html=”<ul class=”at__social”>”; /* array elements: social-media-name/meta-key => [‘href-before-string’, ‘href-after-string’, ‘fa-class’] */ $author_sociables = array( ‘facebook’ => [”, ”, ‘fa-fb’], ‘twitter’ => [”, ”, ‘fa-twitter’], ‘instagram’ => [”, ”, ‘fa-instagram’], ‘google’ => [‘//plus.google.com/’, ”, ‘fa-google-plus’], ‘pinterest’ => [‘//pinterest.com/’, ”, ‘fa-pinterest’], ‘tumblr’ => … Read more

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