Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created December 8, 2014 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommcfarlin/928fbe165653fa3b7c94 to your computer and use it in GitHub Desktop.
Save tommcfarlin/928fbe165653fa3b7c94 to your computer and use it in GitHub Desktop.
[WordPress] An example for how to export all 'Acme Data' custom post types with WP_Query.
<?php
$args = array(
'post_type' => 'acme_data',
'post_status' => 'publish',
'orderby' => 'title',
'order' => 'asc',
'posts_per_page' => -1
);
$custom_query = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment