Skip to content

Instantly share code, notes, and snippets.

@dgwyer
Created September 25, 2021 10:35
Show Gist options
  • Save dgwyer/b34f37f6c3437648d468692157c96950 to your computer and use it in GitHub Desktop.
Save dgwyer/b34f37f6c3437648d468692157c96950 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Post Meta Registration Test
* Version: 0.1.0
* Text Domain: post-meta-registration-test
*/
function register_post_meta_1() {
register_post_meta( 'post', 'test_post_data1', array(
'show_in_rest' => true,
'single' => true,
'type' => 'string',
) );
}
add_action( 'init', 'register_post_meta_1' );
function register_post_meta_2() {
register_meta(
'post',
'test_post_data2', array(
'type' => 'string',
'single' => true,
'show_in_rest' => true,
) );
}
add_action( 'init', 'register_post_meta_2' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment