How to see in Edit Comments if comment is from User and her Roles

Solved with: function myplugin_comment_columns( $columns ) { return array_merge( $columns, array( ‘ruolo’ => __( ‘Ruolo’ ) ) ); } add_filter( ‘manage_edit-comments_columns’, ‘myplugin_comment_columns’ ); function myplugin_comment_column( $column, $comment_ID ) { switch ( $column ) { case ‘ruolo’: if(get_comment($comment_ID)->user_id != “0”) { if(get_comment($comment_ID)->user_id != “1”) { $ruolo = “”; $user_meta=get_userdata(get_comment($comment_ID)->user_id); $ruolo = “Registrato”; if(in_array(‘vip’, ( array )$user_meta->roles)) … Read more

Query for user roles and their skills

There is one small issue. You have to user ‘IN’ instead of = because you want to check values with array $args = array( ‘role’ => ‘candidate’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘as_skills’, ‘value’ => array(‘skilla’,’skillx’,’skille’), ‘compare’ => ‘IN’ ), ), ); $test = get_users($args); echo “<pre>”; print_r($test); echo “</pre>”;

(Who to follow) Twitter widget

It looks like you’re saving a PHP std object in the database. It might be an array, I’d have to check how WordPress saves those. In either case: If you’re using add_user_meta() or update_user_meta() to insert the user meta into the database (and you should be), then using get_user_meta() with the third parameter set to … Read more

Wpdb->last_query returns bad query

get_users() is a convenience wrapper around WP_User_Query. Maybe you can use that directly, e.g. $user_search = new WP_User_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘meta_key’ => ‘last_login’, //’meta_value’ => ‘DATE_SUB(NOW(),INTERVAL 7 DAY)’, ‘meta_value’ => date(‘Y-m-d H:i’, strtotime(‘-7 days’)), ‘meta_compare’ => ‘<=’, ‘type’ => ‘DATE’, ), array( ‘meta_key’ => ’email_not_logged’, ‘meta_compare’ => ‘NOT EXISTS’, … Read more

To save user info on the same page by form submiting

I’m pretty sure you should add the page url (don’t hard-code it) under the form “action” attribute. So assuming you have access to the_permalink(), you should do the following: action=”<?php the_permalink(); ?>” Check if that saves into the $_POST array by adding the following somewhere in that file and try submitting the form: <?php var_dump($_POST);?>

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