Skip to content

Instantly share code, notes, and snippets.

View sunnyluthra's full-sized avatar

Sunny Luthra sunnyluthra

View GitHub Profile
@sunnyluthra
sunnyluthra / get_user_id_by_meta.php
Last active October 8, 2015 06:39
WordPress get user by metakey and value
<?php
function get_user_id_by_meta($key, $value) {
if (!$key && !$value) {
return false;
}
$args = array(
'meta_key' => $key,
'meta_value' => $value,
'fields' => 'ids',
'count_total' => false,
@sunnyluthra
sunnyluthra / find_user_with_skills.php
Created October 27, 2015 08:55
Find wordpress user by meta values
<?php
$args = array(
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'skill',
'value' => 'php',
'compare' => '='
),
<?php
/*
Plugin Name: Bot For WP
Description: Messenger bot for WordPress
Plugin URI: http://snypd.com/
Author: Sunny Luthra
Author URI: http://#
Version: 1.0
License: GPL2
*/