Created
December 16, 2011 19:04
-
-
Save moimikey/1487428 to your computer and use it in GitHub Desktop.
Filtering WordPress output
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 | |
/** | |
* Filter get_post() array with only the relative information that we need | |
* | |
* @access public | |
* @param integer $post_id | |
* @return array | |
* @author moimikey | |
*/ | |
function hertzberg_filter_post_data( $post_id ) { | |
$output = array(); | |
$post = get_post( $post_id ); | |
$filter = new stdClass; | |
$filter->ID = $post->ID; | |
$filter->post_title = $post->post_title; | |
$filter->guid = $post->guid; | |
$filter->post_date = $post->post_date; | |
$output[] = $filter; | |
return $output; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment