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

Output checkbox per user and save in plugin options

Change the [user] to [users][]. Hope that will fix the problem. Now you’ll get all the value in associative array within [users][‘your-checkbox-data-array’] So your code will be like- <?php $WPusers = get_users( ‘orderby=nicename&role=administrator’ ); foreach ( $WPusers as $user ) { ?> <input type=”checkbox” name=”<?php echo $this->plugin_name; ?>[users][]” id=”<?php echo $this->plugin_name; ?>-users” value=”<?php echo $user->ID; … Read more

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