display all posts in wordpress admin

It doesn’t, in the top right under screen options it says, Show on screen, you can set this to a max of 999 ( I have never tried 999 just fyi) and you can select all, then bulk actions—>edit—>apply. Also I think there are plugins that do this that use direct wpdb functions, so you … Read more

The next_posts_link() works only with original $wp_query

next_posts_link and previous_posts_link use the global $wp_query. function get_next_posts_link( $label = null, $max_page = 0 ) { global $paged, $wp_query; http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/link-template.php#L1523 That means you need to do something like this to get those to work correctly. $orig_query = $wp_query; $wp_query = new WP_Query($args); // the rest of your code $wp_query = $orig_query; If you are … Read more

Post featured image column on admin post list page

This is what I’m using, cobbled together from snippets found online… It’s uses a filter on manage_posts_colummns to re-jig the headers and an action on manage_posts_custom_column to add the row level data. function custom_columns( $columns ) { $columns = array( ‘cb’ => ‘<input type=”checkbox” />’, ‘featured_image’ => ‘Image’, ‘title’ => ‘Title’, ‘comments’ => ‘<span class=”vers”><div … Read more

Passing current cookies in wp_remote_get to get Draft Post Preview

I rarely deal with cookies and not sure about complete mechanics there, but here is basic working example of passing current user’s cookies to retrieve preview page source: $preview_link = set_url_scheme( get_permalink( $post->ID ) ); $preview_link = esc_url( apply_filters( ‘preview_post_link’, add_query_arg( ‘preview’, ‘true’, $preview_link ) ) ); $cookies = array(); foreach ( $_COOKIE as $name … Read more

Post preview mechanism architecture

Even if you hit just one button for “Preview” it may ends in 2 different “routes”. The one is something like http://example.com/postname/?preview=true The second is something like: http://example.com/postname/?preview_id=152&preview_nonce=xxx&preview=true so the first contains preview query argument, the second contains preview_id preview_nonce preview query arguments. preview query argument tells WordPress to allow visualization of non-published posts to … Read more