mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-13 19:56:27 +09:00
- using slashes in the callback function setting of the dropdown fields;
This commit is contained in:
@@ -279,7 +279,20 @@ if ( ! class_exists( 'um\core\Query' ) ) {
|
||||
* @param $post_id
|
||||
* @param $new_value
|
||||
*/
|
||||
function update_attr( $key, $post_id, $new_value ){
|
||||
function update_attr( $key, $post_id, $new_value ) {
|
||||
/**
|
||||
* Post meta values are passed through the stripslashes() function upon being stored.
|
||||
* Function wp_slash() is added to compensate for the call to stripslashes().
|
||||
* @see https://developer.wordpress.org/reference/functions/update_post_meta/
|
||||
*/
|
||||
if ( is_array( $new_value ) ) {
|
||||
foreach ( $new_value as $k => $val ) {
|
||||
if ( is_array( $val ) && array_key_exists( 'custom_dropdown_options_source', $val ) ) {
|
||||
$new_value[ $k ]['custom_dropdown_options_source'] = wp_slash( $val['custom_dropdown_options_source'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, '_um_' . $key, $new_value );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user