Simplify pledge meta registration

This commit is contained in:
Corey McKrill 2019-09-30 17:40:49 -07:00
parent 9bf2f9dd1a
commit 7092faebcb
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38

View file

@ -13,17 +13,10 @@ defined( 'WPINC' ) || die();
const META_PREFIX = FiveForTheFuture\PREFIX . '-'; const META_PREFIX = FiveForTheFuture\PREFIX . '-';
add_action( 'init', __NAMESPACE__ . '\register' ); add_action( 'init', __NAMESPACE__ . '\register_pledge_meta' );
add_action( 'admin_init', __NAMESPACE__ . '\add_meta_boxes' ); add_action( 'admin_init', __NAMESPACE__ . '\add_meta_boxes' );
add_action( 'save_post', __NAMESPACE__ . '\save_pledge', 10, 2 ); add_action( 'save_post', __NAMESPACE__ . '\save_pledge', 10, 2 );
/**
*
*/
function register() {
register_pledge_meta();
}
/** /**
* Define pledge meta fields and their properties. * Define pledge meta fields and their properties.
* *
@ -56,7 +49,6 @@ function get_pledge_meta_config() {
'sanitize_callback' => 'absint', 'sanitize_callback' => 'absint',
'required' => true, 'required' => true,
], ],
// todo add # sponsored employees here and also to form, etc
'contact-name' => [ 'contact-name' => [
'show_in_rest' => false, 'show_in_rest' => false,
'sanitize_callback' => 'sanitize_text_field', 'sanitize_callback' => 'sanitize_text_field',