mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 20:26:49 +09:00
-add role_select and role_radio params to the $post_form
This commit is contained in:
@@ -482,3 +482,24 @@
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* add role_select and role_radio to the $post_form
|
||||
* It is necessary for that if on these fields the conditional logic
|
||||
* @param $post_form array
|
||||
* @param $mode
|
||||
*
|
||||
* @return $post_form
|
||||
* @uses hook filters: um_submit_form_data
|
||||
*/
|
||||
function um_submit_form_data_role_fields( $post_form, $mode ) {
|
||||
$custom_fields = unserialize( $post_form['custom_fields'] );
|
||||
if ( ! empty( $post_form['role'] ) && array_key_exists( 'role_select', $custom_fields ) ) {
|
||||
$post_form['role_select'] = $post_form['role'];
|
||||
}
|
||||
if (! empty( $post_form['role'] ) && array_key_exists( 'role_radio', $custom_fields ) ) {
|
||||
$post_form['role_radio'] = $post_form['role'];
|
||||
}
|
||||
|
||||
return $post_form;
|
||||
}
|
||||
add_filter( 'um_submit_form_data', 'um_submit_form_data_role_fields', 10, 2 );
|
||||
Reference in New Issue
Block a user