How to list “invisible” Auto Drafts?

try pasting this in your theme’s functions.php file add_filter( ‘parse_query’, ‘display_autosave_and_revisions’ ); function display_autosave_and_revisions( $query ) { global $pagenow,$typenow; if ( is_admin() && $pagenow == ‘edit.php’ && $typenow == “post”) { $query->query_vars[‘post_type’] = array(‘revision’,’post’); $query->query_vars[‘post_status’] = ‘any’; } }

Listing wordpress users with a search function

This worked for me. $user_query = new WP_User_Query( array( ‘search’ => ‘*example.net*’, ‘search_columns’ => array(‘user_url’) )); $authors = $user_query->get_results(); The wild card to be used in the search string is ‘*’ and not ‘%’. Also you have to include the ‘search_columns’ parameter with the following possible values search_columns = array( ‘user_nicename’, ‘user_login’, ‘user_email’, ‘user_url’ ) … Read more

Latest posts by category — how to exclude current post?

You can use the post__not_in parameter of WP_Query to exclude an array of post IDs from the query. get_the_category() returns an array of term objects, so the get_term_by is redundant. Also is_single() will always be true in content-single.php (not strictly speaking true but only not so if you are interferring with the template selection). (Finally, … Read more