Last active
June 17, 2016 05:34
-
-
Save bacoords/29897b25c7e26e268ecd8b43a67a82bb 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
/** | |
* Retrieve custom meta for use in the REST API | |
* | |
* @param array $object Details of current post. | |
* @param string $field_name Name of field. | |
* @param WP_REST_Request $request Current request | |
* | |
* @return mixed | |
*/ | |
function prefix_get_custom_meta( $object, $field_name, $request ) { | |
return get_post_meta( $object[ 'id' ], $field_name, true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment