mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-22 02:53:43 +03:00
Simplify pledge meta registration
This commit is contained in:
parent
9bf2f9dd1a
commit
7092faebcb
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue