Last active
December 27, 2019 14:17
-
-
Save davidfcarr/7a069565adea092ea863beec1e79e150 to your computer and use it in GitHub Desktop.
Excerpt from init.php for Gutenberg sidebar metadata demo
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( 'init', function(){ | |
register_meta( 'post', '_demo_select', array( | |
'type' => 'string', | |
'single' => true, | |
'show_in_rest' => true, | |
'auth_callback' => function() { | |
return current_user_can('edit_posts'); | |
} | |
) ); | |
register_meta( 'post', '_demo_text_field', array( | |
'type' => 'string', | |
'single' => true, | |
'show_in_rest' => true, | |
'auth_callback' => function() { | |
return current_user_can('edit_posts'); | |
} | |
) ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment