0
votes
2answers
295 views

How to Modify this $wpdb query to accept an array of post statuses

I'm using this function from this accepted answer, which gets all values for a custom field key (cross-post). How could it be modified to allow an array of post statuses? function get_meta_values( ...
0
votes
1answer
78 views

Custom Query for searching through custom fields

Just wondered if someone could spare 5 mins to help me understand where I might be going wrong. I have a set of custom fields for jobs - I would like to create two drop down menus as a quick search: ...
1
vote
0answers
106 views

Changing status of Published posts which have less Content to “Draft”

function draftpost(){ global $wpdb; $prefix = $wpdb->prefix; $wpdb->query("UPDATE ".$prefix."posts SET post_status='draft' WHERE LENGTH( post_content ) <500"); } ...
0
votes
2answers
895 views

How do I modify this wpdb query to include posts that have a post_status of publish and draft?

I'm using the following function to count the number of posts an author has made from a custom post type. <?php function count_user_posts_by_type($userid, $post_type) { global $wpdb; ...