Creating a button from data from Author meta

You just created an empty link, it has correct link but no inner text: echo ‘<a href=”‘ . esc_url( the_author_meta(‘snapchat_profile’)) . ‘”>Follow on Snapchat</a>’; And since you already stored the link in $snapchat_profile variable, no need to call the the_author_meta(‘snapchat_profile’) function once again (it will only reduce in a few bits of extra memory usage … Read more

Get meta key with value for user

Use get_user_meta() to get the meta data associated with the users in your loop: <?php $roles = array(‘autobuyer’); $users = array(); foreach ( $roles as $role ) { $args = array( ‘role’=>$role, ‘orderby’ => ‘registered’, ‘order’ => ‘ASC’, ‘search_columns’ => ‘nicename’, ‘number’=> 0, ‘date_query’ => array( ‘after’ => ‘October 14st, 2013’, ‘before’ => array( ‘year’ … Read more

Plugin MySQL SELECT custom data and filter on user meta

Without a proper SQL query in the question is not possible to write a proper query in the response, but following your pseudo-code approach: SELECT custom-data FROM custom-table LEFT JOIN wp_users ON custom_data.user_id = wp_users.ID LEFT JOIN wp_usermeta ON wp_users.ID = wp_usermeta.user_id WHERE some-condition AND wp_usermeta.meta_key = ‘flag’ AND wp_usermeta.meta_value=”flagvalue” So basically, you need to … Read more

add_user_meta() vs update_user_meta()

You have already found out that using update_user_meta() if the meta field for the user does not exist, it will be added. ie update_user_meta() can do the task of add_user_meta() However, the difference between them is the return values update_user_meta() returns False if no change was made (if the new value was the same as … Read more

get_user_meta and umeta_id

You can fix this in 1 of 2 ways: change the call to add_user_meta() to update_user_meta() when your 1st conditional evals to true. As explained in update_user_meta(), “If the meta field for the user does not exist, it will be added.” pass true as the $unique (4th) param to add_user_meta(). As explained in add_user_meta(), the … Read more

update_user_meta inside a popup/modal

From what I can tell, it sounds like you need to be using AJAX to update that user meta. Also you might need to retrieve the “content” with AJAX as well, so as to get the updated information if the popup modal is called again. There is a lot of documentation on AJAX in wordpress, … Read more

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