Created
July 11, 2013 21:30
-
-
Save whyisjake/5979441 to your computer and use it in GitHub Desktop.
Status links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function to count the statuses of Maker Faire applications | |
*/ | |
function mf_count_post_statuses() { | |
$types = array( | |
'Any' => 'any', | |
'Accepted' => 'accepted', | |
'Draft' => 'draft', | |
'In Progress' => 'in-progress', | |
'Proposed' => 'proposed', | |
'Rejected' => 'rejected', | |
'Waiting for Info' => 'waiting-for-info' | |
); | |
$output = ''; | |
foreach ($types as $k => $type) { | |
$args = array( | |
'post_type' => 'mf_form', | |
'post_status' => 'any', | |
'posts_per_page' => 1500, | |
'faire' => $GLOBALS['current_faire'], | |
'post_status' => $type, | |
'return_fields' => 'ids', | |
); | |
$query = new WP_Query( $args ); | |
$output .= '| <li><a href="edit.php?post_type=mf_form&page=current_faire&post_status=' . $type . '">' . $k . '</a> <span class="count">(' . $query->post_count . ' )</span></li>'; | |
} | |
return substr($output, 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment