Skip to content

Instantly share code, notes, and snippets.

View jaylong255's full-sized avatar
🏠
Working from home

Jay Long jaylong255

🏠
Working from home
View GitHub Profile
#alright best guess here, i'll be honest. i don't use wp-cli a lot other than what comes packaged in a vagrant
wp post meta update <key> upgraded <value> true
/*
honestly, i only use wp-rest now for ajax, so mine would actually look somehting like this:
*/
add_action('rest_api_init',function($server){
register_rest_route('my-plugin/v1','/add-email',array(
'methods' => 'POST',
'callback' => array($this,'add_email') //and i use class-based name-spacing and auto-loading as you can see
) );
});
$args = array(
'post_type' => "company",
'nopaging' => false,
'posts_per_page' => '100',
'meta_query' => array(
'relation' => 'AND',
array(
'orderby' => 'meta_value_num',
'meta_key' => 'sponsored',
'order' => 'DESC'