REST_query_vars for users
REST_query_vars for users
REST_query_vars for users
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
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>”;
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
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
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);?>
Look like you need used hook user_register it’s return to you user id, after that you can save it in DB.
How to get the id of recently registered user from database?
ok everything fixed at the time, I modified the oroginal form with “register_form” and then I called the input with that value in my custom form.
I don’t know a plugin like this. But, my personal solution for this project would be like this : create a custom post type for agents create users role for agents (and users if you want) attach a custom field to users to store the assigned agent (maybe with Advanced custom fields plugin) Create a … Read more