From 9a3fceef163dae196785f583d22ab7bc35ed3077 Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Sun, 30 Dec 2018 00:02:32 +0800 Subject: [PATCH] Fix custom dropdown callback function validation --- includes/core/class-fields.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index b910d2f4..f17b4ed5 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -1096,8 +1096,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( in_array( $type, array( 'select', 'multiselect' ) ) && isset( $data['custom_dropdown_options_source'] ) && ! empty( $data['custom_dropdown_options_source'] ) ) { - $arr_options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] ); - + if( function_exists( $data['custom_dropdown_options_source'] ) ){ + $arr_options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] ); + } }