Add get posts API function

This commit is contained in:
Brian Miyaji
2015-09-23 21:36:09 +10:00
parent ef31865f28
commit 56a3af544b

View File

@@ -25,6 +25,15 @@ function sp_the_time( $post = 0 ) {
echo sp_get_time( $post );
}
function sp_get_posts( $post_type = 'post', $args = array() ) {
$args = array_merge( array(
'post_type' => $post_type,
'numberposts' => -1,
'posts_per_page' => -1,
), $args );
return get_posts( $args );
}
/*
* Event functions
*/