mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 02:15:45 +03:00
Use when saving post
This commit is contained in:
parent
5da4719388
commit
f95a4db541
1 changed files with 2 additions and 3 deletions
|
@ -16,7 +16,7 @@ const META_PREFIX = FiveForTheFuture\PREFIX . '_';
|
||||||
|
|
||||||
add_action( 'init', __NAMESPACE__ . '\register_pledge_meta' );
|
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 );
|
||||||
add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
|
add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
|
||||||
|
|
||||||
// Both hooks must be used because `updated` doesn't fire if the post meta didn't previously exist.
|
// Both hooks must be used because `updated` doesn't fire if the post meta didn't previously exist.
|
||||||
|
@ -200,8 +200,7 @@ function save_pledge( $pledge_id, $pledge ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$definitions = wp_list_pluck( get_pledge_meta_config( 'user_input' ), 'php_filter' );
|
$submitted_meta = PledgeForm\get_form_submission();
|
||||||
$submitted_meta = filter_input_array( INPUT_POST, $definitions );
|
|
||||||
|
|
||||||
if ( is_wp_error( has_required_pledge_meta( $submitted_meta ) ) ) {
|
if ( is_wp_error( has_required_pledge_meta( $submitted_meta ) ) ) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue