true, 'type' => 'string', 'single' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => function() { return current_user_can('edit_posts'); } )); } add_action('init', 'dw_guten_register_media_meta'); function dw_guten_register_desc_meta() { register_meta('post', 'meta_desc', array( 'show_in_rest' => true, 'type' => 'string', 'single' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => function() { return current_user_can('edit_posts'); } )); } add_action('init', 'dw_guten_register_desc_meta'); function dw_guten_add_media_meta_box() { add_meta_box( 'dw_guten_post_options_metabox', 'Post Options', 'dw_guten_post_options_metabox_html', 'post', 'normal', 'default', array('__back_compat_meta_box' => true) ); } add_action( 'add_meta_boxes', 'dw_guten_add_media_meta_box' ); function dw_guten_add_desc_meta_box() { add_meta_box( 'dw_guten_post_options_metabox', 'Post Options', 'dw_guten_post_options_metabox_desc', 'post', 'normal', 'default', array('__back_compat_meta_box' => true) ); } add_action( 'add_meta_boxes', 'dw_guten_add_desc_meta_box' ); function dw_guten_post_options_metabox_html($post) { $field_value = get_post_meta($post->ID, 'media', true); wp_nonce_field( 'dw_guten_update_post_metabox', 'dw_guten_update_post_nonce' ); ?>