mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Add parent option name in child option callback as reference
This commit is contained in:
Vendored
+1
File diff suppressed because one or more lines are too long
@@ -325,6 +325,7 @@ jQuery(document).ready(function() {
|
||||
url: um_scripts.ajax_select_options,
|
||||
type: 'post',
|
||||
data: {
|
||||
parent_option_name: parent_option,
|
||||
parent_option: parent.val(),
|
||||
child_callback: um_ajax_source,
|
||||
child_name: me.attr('name'),
|
||||
|
||||
@@ -675,10 +675,11 @@
|
||||
|
||||
if (in_array( $type, array( 'select', 'multiselect' ) ) && isset( $data['custom_dropdown_options_source'] ) && !empty( $data['custom_dropdown_options_source'] )) {
|
||||
|
||||
if (function_exists( $data['custom_dropdown_options_source'] )) {
|
||||
|
||||
$arr_options = call_user_func( $data['custom_dropdown_options_source'] );
|
||||
|
||||
if ( function_exists( $data['custom_dropdown_options_source'] ) ) {
|
||||
|
||||
$arr_options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] );
|
||||
|
||||
|
||||
if ($type == 'select') {
|
||||
if (isset( $arr_options[$value] ) && !empty( $arr_options[$value] )) {
|
||||
return $arr_options[$value];
|
||||
@@ -726,15 +727,10 @@
|
||||
*/
|
||||
function get_options_from_callback( $data, $type ) {
|
||||
|
||||
if ( in_array( $type, array( 'select', 'multiselect' ) ) && isset( $data['custom_dropdown_options_source'] ) && ! empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
|
||||
if (in_array( $type, array( 'select', 'multiselect' ) ) && isset( $data['custom_dropdown_options_source'] ) && !empty( $data['custom_dropdown_options_source'] )) {
|
||||
|
||||
if (function_exists( $data['custom_dropdown_options_source'] )) {
|
||||
|
||||
$arr_options = call_user_func( $data['custom_dropdown_options_source'] );
|
||||
|
||||
}
|
||||
|
||||
$arr_options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1869,7 +1865,7 @@
|
||||
$has_parent_option && function_exists( $data['custom_dropdown_options_source'] ) &&
|
||||
um_user( $data['parent_dropdown_relationship'] )
|
||||
) {
|
||||
$options = call_user_func( $data['custom_dropdown_options_source'] );
|
||||
$options = call_user_func( $data['custom_dropdown_options_source'], $data['parent_dropdown_relationship'] );
|
||||
$disabled_by_parent_option = '';
|
||||
if (um_user( $form_key )) {
|
||||
$select_original_option_value = " data-um-original-value='" . um_user( $form_key ) . "' ";
|
||||
|
||||
@@ -71,7 +71,7 @@ if ( ! class_exists( 'Form' ) ) {
|
||||
|
||||
$arr_options['field'] = $form_fields[ $_POST['child_name'] ];
|
||||
if( function_exists( $ajax_source_func ) ){
|
||||
$arr_options['items'] = call_user_func( $ajax_source_func );
|
||||
$arr_options['items'] = call_user_func( $ajax_source_func, $arr_options['field']['parent_dropdown_relationship'] );
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user