WP_User_Query with 2 sets of conditions ‘AND’

You have an example here: https://codex.wordpress.org/Class_Reference/WP_User_Query#Custom_Field_Parameters Problem with your query is that you use wrong keys. It should be: $args = array ( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => $campaign_type, ‘value’ => $Campaign_ID, ‘compare’ => ‘=’ ), array( ‘key’ => ‘organisation’, ‘value’ => $userOrg, ‘compare’ => ‘=’ ) )); Longer versions (meta_key, … Read more

How to query 5 users in random who have published more than 10 posts

I tried this code and it should work for you In your function.php to make random order available in WP_User_Query function my_random_user_query( $class ) { if( ‘rand’ == $class->query_vars[‘orderby’] ) $class->query_orderby = str_replace( ‘user_login’, ‘RAND()’, $class->query_orderby ); return $class; } add_action( ‘pre_user_query’, ‘my_random_user_query’ ); Source And a query like this // Get all users id … Read more

wp_get_current_user return ID = 0 when used outside of wordpress, such as webhook / fulfillment dialogflow

I dont understand where are you calling from. I can give you an alternative solution that may or may not work in your case (since I don’t fully understand your case): This is your ajax-url on your site: echo admin_url( ‘admin-ajax.php’ ); Usually we attach it to the JS to run AJAX calls: wp_localize_script( ‘THE_JS_THAT … Read more

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