Created
September 1, 2016 14:31
-
-
Save websupporter/617f4b917fef293e758c58646a5500c3 to your computer and use it in GitHub Desktop.
register_rest_field() #wcfra
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 | |
add_action( 'rest_api_init', 'slug_register_something_random' ); | |
function slug_register_something_random() { | |
register_rest_field( 'post', | |
'something', | |
array( | |
'get_callback' => 'slug_get_something', | |
'update_callback' => 'slug_update_something', | |
'schema' => null, | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment