mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 14:43:49 +09:00
- code review;
This commit is contained in:
@@ -215,8 +215,8 @@ function um_user_edit_profile( $args ) {
|
||||
*/
|
||||
do_action( 'um_user_before_updating_profile', $userinfo );
|
||||
|
||||
if ( !empty( $args[ 'custom_fields' ] ) ) {
|
||||
$fields = apply_filters( 'um_user_edit_profile_fields', unserialize( $args[ 'custom_fields' ] ), $args );
|
||||
if ( ! empty( $args['custom_fields'] ) ) {
|
||||
$fields = apply_filters( 'um_user_edit_profile_fields', unserialize( $args['custom_fields'] ), $args );
|
||||
}
|
||||
|
||||
// loop through fields
|
||||
@@ -251,19 +251,19 @@ function um_user_edit_profile( $args ) {
|
||||
* Returns dropdown/multi-select options keys from a callback function
|
||||
* @since 2019-05-30
|
||||
*/
|
||||
$has_custom_source = apply_filters("um_has_dropdown_options_source__{$key}", false );
|
||||
|
||||
if ( isset( $array[ 'options' ] ) && in_array( $array[ 'type' ], array( 'select', 'multiselect' ) ) ) {
|
||||
|
||||
if ( !empty( $array[ 'custom_dropdown_options_source' ] ) && function_exists( $array[ 'custom_dropdown_options_source' ] ) && ! $has_custom_source ) {
|
||||
$options = call_user_func( $array[ 'custom_dropdown_options_source' ], $array[ 'options' ] );
|
||||
if( is_array( $options ) ){
|
||||
$array[ 'options' ] = apply_filters("um_custom_dropdown_options__{$key}", array_keys( $options ) );
|
||||
$has_custom_source = apply_filters( "um_has_dropdown_options_source__{$key}", false );
|
||||
if ( isset( $array['options'] ) && in_array( $array['type'], array( 'select', 'multiselect' ) ) ) {
|
||||
|
||||
$options = array();
|
||||
if ( ! empty( $array['custom_dropdown_options_source'] ) && function_exists( $array['custom_dropdown_options_source'] ) && ! $has_custom_source ) {
|
||||
$callback_result = call_user_func( $array['custom_dropdown_options_source'], $array['options'] );
|
||||
if ( is_array( $callback_result ) ) {
|
||||
$options = array_keys( $callback_result );
|
||||
}
|
||||
}else{
|
||||
$array[ 'options' ] = apply_filters("um_custom_dropdown_options__{$key}", array() );
|
||||
}
|
||||
|
||||
$array['options'] = apply_filters( "um_custom_dropdown_options__{$key}", $options );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user