Created
May 27, 2014 16:54
-
-
Save DrewAPicture/0f57ddb11b40bd2a986b to your computer and use it in GitHub Desktop.
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 | |
$id = (int) $id; | |
if ( empty( $id ) ) { | |
return new WP_Error( 'json_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); | |
} | |
$post = get_post( $id, ARRAY_A ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment