Last active
September 2, 2016 12:10
-
-
Save websupporter/e75000f6099cca043234239a798e9591 to your computer and use it in GitHub Desktop.
How to Register custom fields for the REST API
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 | |
$args = array( | |
'type' => 'string', | |
'description' => 'The International Standard Book Number', | |
'single' => true, | |
'sanitize_callback' => 'sanitize_isbn', | |
'auth_callback' => 'is_allowed_to_change_isbn', | |
'show_in_rest' => true, | |
); | |
register_meta( 'post', 'isbn', $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment