From d06f17c3d0ef91d2e0c14ef884aa31d336973e47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rabbi=20Islam=20Rony=20=E2=9A=A1=EF=B8=8F?=
<35329385+RabbiIslamRony@users.noreply.github.com>
Date: Thu, 26 Feb 2026 12:58:27 +0600
Subject: [PATCH 1/3] fix listing card label issue and removed unnessery
function
---
templates/archive/fields/phone.php | 7 +++++--
templates/single/action-section.php | 8 ++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/templates/archive/fields/phone.php b/templates/archive/fields/phone.php
index 2b4bc2531..1ab26b132 100644
--- a/templates/archive/fields/phone.php
+++ b/templates/archive/fields/phone.php
@@ -17,19 +17,22 @@
'whatsapp' => $is_whatsapp,
]
);
+$phone_label = ! empty( $data['original_field']['label'] )
+ ? $data['original_field']['label']
+ : ( ! empty( $data['label'] ) ? $data['label'] : $label );
?>
- print_label( $label ); ?>
+ print_label( $phone_label ); ?>
diff --git a/templates/single/action-section.php b/templates/single/action-section.php
index d50c47f9f..da831e20b 100644
--- a/templates/single/action-section.php
+++ b/templates/single/action-section.php
@@ -88,7 +88,9 @@
$phone_icon = ! empty( $action['icon'] ) ? $action['icon'] : 'las la-phone';
if ( $is_whatsapp ) :
- $phone_label = ! empty( $action['form_data']['label'] ) ? $action['form_data']['label'] : __( 'WhatsApp', 'directorist' );
+ $phone_label = ! empty( $action['form_data']['label'] )
+ ? $action['form_data']['label']
+ : ( ! empty( $action['label'] ) ? $action['label'] : '' );
?>
@@ -96,7 +98,9 @@
From 7d25886fd113e8fbb45ea0ba3608b640d6bf6a44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rabbi=20Islam=20Rony=20=E2=9A=A1=EF=B8=8F?=
<35329385+RabbiIslamRony@users.noreply.github.com>
Date: Sun, 1 Mar 2026 10:44:43 +0600
Subject: [PATCH 2/3] fix: include button field in conditional logic and
evaluate button values reliably
---
assets/js/add-listing.js | 19 ++
assets/js/admin-multi-directory-builder.js | 204 +++++++++---------
assets/js/admin-settings-manager.js | 204 +++++++++---------
assets/js/range-slider.js | 3 +-
assets/js/search-form.js | 19 ++
.../form-fields/conditional-logic-field.js | 7 +-
.../conditional-logic/get-field-value.js | 28 +++
package.json | 5 +-
8 files changed, 274 insertions(+), 215 deletions(-)
diff --git a/assets/js/add-listing.js b/assets/js/add-listing.js
index f776185b1..dee816dba 100644
--- a/assets/js/add-listing.js
+++ b/assets/js/add-listing.js
@@ -1313,6 +1313,25 @@ function getFieldValue(fieldKey, $) {
}
return null;
}
+
+ // Special handling for custom button fields.
+ // Button fields store values in nested keys: field_key[button_text], field_key[button_url_label].
+ if (fieldKey && typeof fieldKey === 'string') {
+ var normalizedButtonFieldKey = fieldKey.trim();
+ if (normalizedButtonFieldKey) {
+ var buttonTextId = (0,_field_mapping_js__WEBPACK_IMPORTED_MODULE_1__.escapeCssId)("".concat(normalizedButtonFieldKey, "_text"));
+ var buttonUrlId = (0,_field_mapping_js__WEBPACK_IMPORTED_MODULE_1__.escapeCssId)("".concat(normalizedButtonFieldKey, "_link"));
+ var $buttonTextField = $("[name=\"".concat(normalizedButtonFieldKey, "[button_text]\"], #").concat(buttonTextId)).first();
+ var $buttonUrlField = $("[name=\"".concat(normalizedButtonFieldKey, "[button_url_label]\"], #").concat(buttonUrlId)).first();
+ if ($buttonTextField.length || $buttonUrlField.length) {
+ var buttonTextValue = $buttonTextField.length ? String($buttonTextField.val() || '').trim() : '';
+ var buttonUrlValue = $buttonUrlField.length ? String($buttonUrlField.val() || '').trim() : '';
+
+ // Prefer button text for direct comparisons; fallback to URL.
+ return buttonTextValue || buttonUrlValue || null;
+ }
+ }
+ }
var $field = null;
// Handle category, tag, and location fields
diff --git a/assets/js/admin-multi-directory-builder.js b/assets/js/admin-multi-directory-builder.js
index 1d3fbfeff..d41c62e99 100644
--- a/assets/js/admin-multi-directory-builder.js
+++ b/assets/js/admin-multi-directory-builder.js
@@ -874,9 +874,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var validation_classes = this.validationLog.inputErrorClasses ? this.validationLog.inputErrorClasses : {};
return _objectSpread({}, validation_classes);
},
- /**
- * Get available fields for conditional logic.
- * Fields that can be used in conditions.
+ /**
+ * Get available fields for conditional logic.
+ * Fields that can be used in conditions.
*/
availableFields: function availableFields() {
// Get all form fields from the submission form fields
@@ -894,14 +894,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// This will be properly implemented when we connect to form builder
return fields;
},
- /**
- * Check if only one rule/group exists (cannot delete)
+ /**
+ * Check if only one rule/group exists (cannot delete)
*/
canDeleteRule: function canDeleteRule() {
return this.localValue.groups.length > 1;
},
- /**
- * Check if a specific group can be deleted
+ /**
+ * Check if a specific group can be deleted
*/
canDeleteGroup: function canDeleteGroup(groupIndex) {
// Can delete if there's more than one group, or if this group has multiple conditions
@@ -937,10 +937,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
setup: function setup() {
// Setup initialization
},
- /**
- * Decode HTML entities in a string
- * @param {string} str - String potentially containing HTML entities
- * @returns {string} - Decoded string
+ /**
+ * Decode HTML entities in a string
+ * @param {string} str - String potentially containing HTML entities
+ * @returns {string} - Decoded string
*/
decodeHtmlEntities: function decodeHtmlEntities(str) {
if (!str || typeof str !== 'string') {
@@ -1017,9 +1017,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
this.updateValue();
},
- /**
- * Store the current field key for exclusion from available fields dropdown
- * This is called when conditional logic is enabled
+ /**
+ * Store the current field key for exclusion from available fields dropdown
+ * This is called when conditional logic is enabled
*/
storeCurrentFieldKey: function storeCurrentFieldKey() {
var fieldKey = this.findCurrentFieldKey();
@@ -1027,9 +1027,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
this.currentFieldKeyForExclusion = fieldKey;
}
},
- /**
- * Find the current field key - SIMPLIFIED APPROACH
- * Extract from fieldId or match activeWidget with availableFields
+ /**
+ * Find the current field key - SIMPLIFIED APPROACH
+ * Extract from fieldId or match activeWidget with availableFields
*/
findCurrentFieldKey: function findCurrentFieldKey() {
var skipKeys = ['logic', 'conditional_logic', 'conditional-logic', 'conditionalLogic', 'submission_form_fields', 'search_form_fields', 'widgets', 'fields'];
@@ -1306,9 +1306,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
condition.value = value;
this.updateValue();
},
- /**
- * Get fields from root context (form builder).
- * This method will extract available fields from the submission form fields.
+ /**
+ * Get fields from root context (form builder).
+ * This method will extract available fields from the submission form fields.
*/
getFieldsFromRoot: function getFieldsFromRoot() {
// Try multiple methods to find the form builder component
@@ -1372,10 +1372,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return [];
},
- /**
- * Format fields from form builder for dropdown options.
- * @param {Object} activeWidgetFields - Object with widget_key as keys and field data as values
- * @returns {Array} Array of field options for dropdown
+ /**
+ * Format fields from form builder for dropdown options.
+ * @param {Object} activeWidgetFields - Object with widget_key as keys and field data as values
+ * @returns {Array} Array of field options for dropdown
*/
formatFieldsForDropdown: function formatFieldsForDropdown(activeWidgetFields) {
if (!activeWidgetFields || (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(activeWidgetFields) !== 'object') {
@@ -1406,7 +1406,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Only include fields that can be used in conditions
// Exclude fields like conditional-logic itself and non-comparable types
// Note: date, time, and file fields are now included (they use specialized inputs)
- var excludeTypes = ['conditional-logic', 'button', 'submit', 'section'];
+ var excludeTypes = ['conditional-logic', 'submit', 'section'];
if (excludeTypes.includes(type)) {
continue;
}
@@ -1442,8 +1442,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
});
return fields;
},
- /**
- * Get value input component based on selected field type.
+ /**
+ * Get value input component based on selected field type.
*/
getValueInputComponent: function getValueInputComponent(condition) {
if (!condition.field) {
@@ -1454,15 +1454,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// For now, return text field
return 'text-field';
},
- /**
- * Check if value input should be hidden based on operator.
+ /**
+ * Check if value input should be hidden based on operator.
*/
isValueHidden: function isValueHidden(operator) {
var hiddenOperators = ['empty', 'not empty'];
return hiddenOperators.includes(operator);
},
- /**
- * Get field data by field key from availableFields
+ /**
+ * Get field data by field key from availableFields
*/
getFieldData: function getFieldData(fieldKey) {
if (!fieldKey || !this.availableFields) {
@@ -1472,9 +1472,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return f.value === fieldKey;
}) || null;
},
- /**
- * Get value options for a condition based on selected field type
- * Returns options array or null if field doesn't need a select dropdown
+ /**
+ * Get value options for a condition based on selected field type
+ * Returns options array or null if field doesn't need a select dropdown
*/
getValueOptions: function getValueOptions(condition) {
var _this3 = this;
@@ -1657,9 +1657,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// For other field types, return null to show text input
return null;
},
- /**
- * Get options from linked field (widget.original_widget_key).
- * Same structure for both forms - used when a field references another for options.
+ /**
+ * Get options from linked field (widget.original_widget_key).
+ * Same structure for both forms - used when a field references another for options.
*/
getOptionsFromLinkedField: function getOptionsFromLinkedField(widget) {
var originalKey = widget && widget.original_widget_key;
@@ -1669,8 +1669,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var sourceWidget = linked.value.fields[originalKey];
return this.extractOptionsFromWidget(sourceWidget);
},
- /**
- * Extract option array from a widget (select/radio/checkbox)
+ /**
+ * Extract option array from a widget (select/radio/checkbox)
*/
extractOptionsFromWidget: function extractOptionsFromWidget(sourceWidget) {
var _this4 = this;
@@ -1740,8 +1740,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return options.length > 0 ? options : null;
},
- /**
- * Check if condition needs a select dropdown (has options)
+ /**
+ * Check if condition needs a select dropdown (has options)
*/
needsSelectInput: function needsSelectInput(condition) {
// File fields need a selectbox with "uploaded" option
@@ -1758,8 +1758,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return this.getValueOptions(condition) !== null;
},
- /**
- * Check if field is a date type
+ /**
+ * Check if field is a date type
*/
isDateField: function isDateField(condition) {
if (!condition || !condition.field) {
@@ -1772,8 +1772,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'date';
},
- /**
- * Check if field is a time type
+ /**
+ * Check if field is a time type
*/
isTimeField: function isTimeField(condition) {
if (!condition || !condition.field) {
@@ -1786,8 +1786,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'time';
},
- /**
- * Check if field is a color type
+ /**
+ * Check if field is a color type
*/
isColorField: function isColorField(condition) {
if (!condition || !condition.field) {
@@ -1800,8 +1800,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'color' || fieldType === 'color_picker';
},
- /**
- * Check if field is a file type
+ /**
+ * Check if field is a file type
*/
isFileField: function isFileField(condition) {
if (!condition || !condition.field) {
@@ -1820,8 +1820,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'file' || fieldType === 'file_upload';
},
- /**
- * Get listing type ID from Vue context
+ /**
+ * Get listing type ID from Vue context
*/
getListingTypeId: function getListingTypeId() {
// Try to get from URL parameter
@@ -1848,10 +1848,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return null;
},
- /**
- * Get category options for the current directory type
- * This will be populated from available data or needs AJAX call
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get category options for the current directory type
+ * This will be populated from available data or needs AJAX call
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getCategoryOptions: function getCategoryOptions(fieldKey) {
var _this5 = this;
@@ -1939,10 +1939,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Return empty array for now - will be populated via AJAX if needed
return [];
},
- /**
- * Get tag options for the current directory type
- * Similar to getCategoryOptions() but for tags
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get tag options for the current directory type
+ * Similar to getCategoryOptions() but for tags
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getTagOptions: function getTagOptions(fieldKey) {
var _this6 = this;
@@ -2024,10 +2024,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return [];
},
- /**
- * Get location options for the current directory type
- * Similar to getCategoryOptions() but for locations
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get location options for the current directory type
+ * Similar to getCategoryOptions() but for locations
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getLocationOptions: function getLocationOptions(fieldKey) {
var _this7 = this;
@@ -3630,8 +3630,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return option_object;
}
- /* syncValidationWithLocalState( validation_log ) {
- return validation_log;
+ /* syncValidationWithLocalState( validation_log ) {
+ return validation_log;
} */
}
});
@@ -5198,24 +5198,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return props;
}
},
- /**
- * Evaluate conditional logic rules in the new format.
- * @param {Object} conditionalLogic - Conditional logic configuration
- * @param {Object} rootFields - Root fields object containing all field values
- * @returns {Boolean} - True if conditions are met
+ /**
+ * Evaluate conditional logic rules in the new format.
+ * @param {Object} conditionalLogic - Conditional logic configuration
+ * @param {Object} rootFields - Root fields object containing all field values
+ * @returns {Boolean} - True if conditions are met
*/
- /**
- * Evaluate conditional logic rules for admin form builder preview
- *
- * This function is used in the ADMIN FORM BUILDER to show/hide fields in the preview
- * based on conditional logic rules configured by the admin user.
- *
- * @param {Object} conditionalLogic - Conditional logic configuration
- * @param {Object} rootFields - All field values from the form builder (rootFields object)
- * @returns {boolean} - true if field should be shown, false if hidden
- *
- * Usage: Called from Field_List_Component.vue (line 167) to filter visible fields
- * in the admin form builder preview as the admin configures conditional logic rules.
+ /**
+ * Evaluate conditional logic rules for admin form builder preview
+ *
+ * This function is used in the ADMIN FORM BUILDER to show/hide fields in the preview
+ * based on conditional logic rules configured by the admin user.
+ *
+ * @param {Object} conditionalLogic - Conditional logic configuration
+ * @param {Object} rootFields - All field values from the form builder (rootFields object)
+ * @returns {boolean} - true if field should be shown, false if hidden
+ *
+ * Usage: Called from Field_List_Component.vue (line 167) to filter visible fields
+ * in the admin form builder preview as the admin configures conditional logic rules.
*/
evaluateConditionalLogic: function evaluateConditionalLogic(conditionalLogic, rootFields) {
if (!conditionalLogic || !conditionalLogic.enabled) {
@@ -5336,11 +5336,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Default to show
return result;
},
- /**
- * Get field value from root fields for condition evaluation.
- * @param {Object} rootFields - Root fields object
- * @param {String} fieldKey - Field key to get value for
- * @returns {*} - Field value
+ /**
+ * Get field value from root fields for condition evaluation.
+ * @param {Object} rootFields - Root fields object
+ * @param {String} fieldKey - Field key to get value for
+ * @returns {*} - Field value
*/
getFieldValueForCondition: function getFieldValueForCondition(rootFields, fieldKey) {
if (!rootFields || !fieldKey) {
@@ -5363,11 +5363,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return null;
},
- /**
- * Evaluate a single condition.
- * @param {Object} condition - Condition object with field, operator, value
- * @param {*} fieldValue - Current value of the field being checked
- * @returns {Boolean} - True if condition is met
+ /**
+ * Evaluate a single condition.
+ * @param {Object} condition - Condition object with field, operator, value
+ * @param {*} fieldValue - Current value of the field being checked
+ * @returns {Boolean} - True if condition is met
*/
evaluateCondition: function evaluateCondition(condition, fieldValue) {
if (!condition.operator) {
@@ -5445,12 +5445,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return false;
}
},
- /**
- * Evaluate condition for array values (multi-select fields).
- * @param {Array} fieldArray - Array of field values
- * @param {*} conditionValue - Value to compare against
- * @param {String} operator - Comparison operator
- * @returns {Boolean}
+ /**
+ * Evaluate condition for array values (multi-select fields).
+ * @param {Array} fieldArray - Array of field values
+ * @param {*} conditionValue - Value to compare against
+ * @param {String} operator - Comparison operator
+ * @returns {Boolean}
*/
evaluateArrayCondition: function evaluateArrayCondition(fieldArray, conditionValue, operator) {
if (!Array.isArray(fieldArray) || fieldArray.length === 0) {
@@ -5543,10 +5543,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return false;
}
},
- /**
- * Check if a value is empty.
- * @param {*} value - Value to check
- * @returns {Boolean}
+ /**
+ * Check if a value is empty.
+ * @param {*} value - Value to check
+ * @returns {Boolean}
*/
isEmpty: function isEmpty(value) {
if (value === null || value === undefined) {
diff --git a/assets/js/admin-settings-manager.js b/assets/js/admin-settings-manager.js
index 7b2930685..26a12a728 100644
--- a/assets/js/admin-settings-manager.js
+++ b/assets/js/admin-settings-manager.js
@@ -807,9 +807,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var validation_classes = this.validationLog.inputErrorClasses ? this.validationLog.inputErrorClasses : {};
return _objectSpread({}, validation_classes);
},
- /**
- * Get available fields for conditional logic.
- * Fields that can be used in conditions.
+ /**
+ * Get available fields for conditional logic.
+ * Fields that can be used in conditions.
*/
availableFields: function availableFields() {
// Get all form fields from the submission form fields
@@ -827,14 +827,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// This will be properly implemented when we connect to form builder
return fields;
},
- /**
- * Check if only one rule/group exists (cannot delete)
+ /**
+ * Check if only one rule/group exists (cannot delete)
*/
canDeleteRule: function canDeleteRule() {
return this.localValue.groups.length > 1;
},
- /**
- * Check if a specific group can be deleted
+ /**
+ * Check if a specific group can be deleted
*/
canDeleteGroup: function canDeleteGroup(groupIndex) {
// Can delete if there's more than one group, or if this group has multiple conditions
@@ -870,10 +870,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
setup: function setup() {
// Setup initialization
},
- /**
- * Decode HTML entities in a string
- * @param {string} str - String potentially containing HTML entities
- * @returns {string} - Decoded string
+ /**
+ * Decode HTML entities in a string
+ * @param {string} str - String potentially containing HTML entities
+ * @returns {string} - Decoded string
*/
decodeHtmlEntities: function decodeHtmlEntities(str) {
if (!str || typeof str !== 'string') {
@@ -950,9 +950,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
this.updateValue();
},
- /**
- * Store the current field key for exclusion from available fields dropdown
- * This is called when conditional logic is enabled
+ /**
+ * Store the current field key for exclusion from available fields dropdown
+ * This is called when conditional logic is enabled
*/
storeCurrentFieldKey: function storeCurrentFieldKey() {
var fieldKey = this.findCurrentFieldKey();
@@ -960,9 +960,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
this.currentFieldKeyForExclusion = fieldKey;
}
},
- /**
- * Find the current field key - SIMPLIFIED APPROACH
- * Extract from fieldId or match activeWidget with availableFields
+ /**
+ * Find the current field key - SIMPLIFIED APPROACH
+ * Extract from fieldId or match activeWidget with availableFields
*/
findCurrentFieldKey: function findCurrentFieldKey() {
var skipKeys = ['logic', 'conditional_logic', 'conditional-logic', 'conditionalLogic', 'submission_form_fields', 'search_form_fields', 'widgets', 'fields'];
@@ -1239,9 +1239,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
condition.value = value;
this.updateValue();
},
- /**
- * Get fields from root context (form builder).
- * This method will extract available fields from the submission form fields.
+ /**
+ * Get fields from root context (form builder).
+ * This method will extract available fields from the submission form fields.
*/
getFieldsFromRoot: function getFieldsFromRoot() {
// Try multiple methods to find the form builder component
@@ -1305,10 +1305,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return [];
},
- /**
- * Format fields from form builder for dropdown options.
- * @param {Object} activeWidgetFields - Object with widget_key as keys and field data as values
- * @returns {Array} Array of field options for dropdown
+ /**
+ * Format fields from form builder for dropdown options.
+ * @param {Object} activeWidgetFields - Object with widget_key as keys and field data as values
+ * @returns {Array} Array of field options for dropdown
*/
formatFieldsForDropdown: function formatFieldsForDropdown(activeWidgetFields) {
if (!activeWidgetFields || (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(activeWidgetFields) !== 'object') {
@@ -1339,7 +1339,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Only include fields that can be used in conditions
// Exclude fields like conditional-logic itself and non-comparable types
// Note: date, time, and file fields are now included (they use specialized inputs)
- var excludeTypes = ['conditional-logic', 'button', 'submit', 'section'];
+ var excludeTypes = ['conditional-logic', 'submit', 'section'];
if (excludeTypes.includes(type)) {
continue;
}
@@ -1375,8 +1375,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
});
return fields;
},
- /**
- * Get value input component based on selected field type.
+ /**
+ * Get value input component based on selected field type.
*/
getValueInputComponent: function getValueInputComponent(condition) {
if (!condition.field) {
@@ -1387,15 +1387,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// For now, return text field
return 'text-field';
},
- /**
- * Check if value input should be hidden based on operator.
+ /**
+ * Check if value input should be hidden based on operator.
*/
isValueHidden: function isValueHidden(operator) {
var hiddenOperators = ['empty', 'not empty'];
return hiddenOperators.includes(operator);
},
- /**
- * Get field data by field key from availableFields
+ /**
+ * Get field data by field key from availableFields
*/
getFieldData: function getFieldData(fieldKey) {
if (!fieldKey || !this.availableFields) {
@@ -1405,9 +1405,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return f.value === fieldKey;
}) || null;
},
- /**
- * Get value options for a condition based on selected field type
- * Returns options array or null if field doesn't need a select dropdown
+ /**
+ * Get value options for a condition based on selected field type
+ * Returns options array or null if field doesn't need a select dropdown
*/
getValueOptions: function getValueOptions(condition) {
var _this3 = this;
@@ -1590,9 +1590,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// For other field types, return null to show text input
return null;
},
- /**
- * Get options from linked field (widget.original_widget_key).
- * Same structure for both forms - used when a field references another for options.
+ /**
+ * Get options from linked field (widget.original_widget_key).
+ * Same structure for both forms - used when a field references another for options.
*/
getOptionsFromLinkedField: function getOptionsFromLinkedField(widget) {
var originalKey = widget && widget.original_widget_key;
@@ -1602,8 +1602,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var sourceWidget = linked.value.fields[originalKey];
return this.extractOptionsFromWidget(sourceWidget);
},
- /**
- * Extract option array from a widget (select/radio/checkbox)
+ /**
+ * Extract option array from a widget (select/radio/checkbox)
*/
extractOptionsFromWidget: function extractOptionsFromWidget(sourceWidget) {
var _this4 = this;
@@ -1673,8 +1673,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return options.length > 0 ? options : null;
},
- /**
- * Check if condition needs a select dropdown (has options)
+ /**
+ * Check if condition needs a select dropdown (has options)
*/
needsSelectInput: function needsSelectInput(condition) {
// File fields need a selectbox with "uploaded" option
@@ -1691,8 +1691,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return this.getValueOptions(condition) !== null;
},
- /**
- * Check if field is a date type
+ /**
+ * Check if field is a date type
*/
isDateField: function isDateField(condition) {
if (!condition || !condition.field) {
@@ -1705,8 +1705,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'date';
},
- /**
- * Check if field is a time type
+ /**
+ * Check if field is a time type
*/
isTimeField: function isTimeField(condition) {
if (!condition || !condition.field) {
@@ -1719,8 +1719,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'time';
},
- /**
- * Check if field is a color type
+ /**
+ * Check if field is a color type
*/
isColorField: function isColorField(condition) {
if (!condition || !condition.field) {
@@ -1733,8 +1733,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'color' || fieldType === 'color_picker';
},
- /**
- * Check if field is a file type
+ /**
+ * Check if field is a file type
*/
isFileField: function isFileField(condition) {
if (!condition || !condition.field) {
@@ -1753,8 +1753,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
var fieldType = (fieldData.type || '').toString().trim().toLowerCase();
return fieldType === 'file' || fieldType === 'file_upload';
},
- /**
- * Get listing type ID from Vue context
+ /**
+ * Get listing type ID from Vue context
*/
getListingTypeId: function getListingTypeId() {
// Try to get from URL parameter
@@ -1781,10 +1781,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return null;
},
- /**
- * Get category options for the current directory type
- * This will be populated from available data or needs AJAX call
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get category options for the current directory type
+ * This will be populated from available data or needs AJAX call
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getCategoryOptions: function getCategoryOptions(fieldKey) {
var _this5 = this;
@@ -1872,10 +1872,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Return empty array for now - will be populated via AJAX if needed
return [];
},
- /**
- * Get tag options for the current directory type
- * Similar to getCategoryOptions() but for tags
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get tag options for the current directory type
+ * Similar to getCategoryOptions() but for tags
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getTagOptions: function getTagOptions(fieldKey) {
var _this6 = this;
@@ -1957,10 +1957,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return [];
},
- /**
- * Get location options for the current directory type
- * Similar to getCategoryOptions() but for locations
- * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
+ /**
+ * Get location options for the current directory type
+ * Similar to getCategoryOptions() but for locations
+ * @param {string} [fieldKey] - Optional field key (supports submission + search form keys)
*/
getLocationOptions: function getLocationOptions(fieldKey) {
var _this7 = this;
@@ -3563,8 +3563,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return option_object;
}
- /* syncValidationWithLocalState( validation_log ) {
- return validation_log;
+ /* syncValidationWithLocalState( validation_log ) {
+ return validation_log;
} */
}
});
@@ -5131,24 +5131,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return props;
}
},
- /**
- * Evaluate conditional logic rules in the new format.
- * @param {Object} conditionalLogic - Conditional logic configuration
- * @param {Object} rootFields - Root fields object containing all field values
- * @returns {Boolean} - True if conditions are met
+ /**
+ * Evaluate conditional logic rules in the new format.
+ * @param {Object} conditionalLogic - Conditional logic configuration
+ * @param {Object} rootFields - Root fields object containing all field values
+ * @returns {Boolean} - True if conditions are met
*/
- /**
- * Evaluate conditional logic rules for admin form builder preview
- *
- * This function is used in the ADMIN FORM BUILDER to show/hide fields in the preview
- * based on conditional logic rules configured by the admin user.
- *
- * @param {Object} conditionalLogic - Conditional logic configuration
- * @param {Object} rootFields - All field values from the form builder (rootFields object)
- * @returns {boolean} - true if field should be shown, false if hidden
- *
- * Usage: Called from Field_List_Component.vue (line 167) to filter visible fields
- * in the admin form builder preview as the admin configures conditional logic rules.
+ /**
+ * Evaluate conditional logic rules for admin form builder preview
+ *
+ * This function is used in the ADMIN FORM BUILDER to show/hide fields in the preview
+ * based on conditional logic rules configured by the admin user.
+ *
+ * @param {Object} conditionalLogic - Conditional logic configuration
+ * @param {Object} rootFields - All field values from the form builder (rootFields object)
+ * @returns {boolean} - true if field should be shown, false if hidden
+ *
+ * Usage: Called from Field_List_Component.vue (line 167) to filter visible fields
+ * in the admin form builder preview as the admin configures conditional logic rules.
*/
evaluateConditionalLogic: function evaluateConditionalLogic(conditionalLogic, rootFields) {
if (!conditionalLogic || !conditionalLogic.enabled) {
@@ -5269,11 +5269,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
// Default to show
return result;
},
- /**
- * Get field value from root fields for condition evaluation.
- * @param {Object} rootFields - Root fields object
- * @param {String} fieldKey - Field key to get value for
- * @returns {*} - Field value
+ /**
+ * Get field value from root fields for condition evaluation.
+ * @param {Object} rootFields - Root fields object
+ * @param {String} fieldKey - Field key to get value for
+ * @returns {*} - Field value
*/
getFieldValueForCondition: function getFieldValueForCondition(rootFields, fieldKey) {
if (!rootFields || !fieldKey) {
@@ -5296,11 +5296,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
}
return null;
},
- /**
- * Evaluate a single condition.
- * @param {Object} condition - Condition object with field, operator, value
- * @param {*} fieldValue - Current value of the field being checked
- * @returns {Boolean} - True if condition is met
+ /**
+ * Evaluate a single condition.
+ * @param {Object} condition - Condition object with field, operator, value
+ * @param {*} fieldValue - Current value of the field being checked
+ * @returns {Boolean} - True if condition is met
*/
evaluateCondition: function evaluateCondition(condition, fieldValue) {
if (!condition.operator) {
@@ -5378,12 +5378,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return false;
}
},
- /**
- * Evaluate condition for array values (multi-select fields).
- * @param {Array} fieldArray - Array of field values
- * @param {*} conditionValue - Value to compare against
- * @param {String} operator - Comparison operator
- * @returns {Boolean}
+ /**
+ * Evaluate condition for array values (multi-select fields).
+ * @param {Array} fieldArray - Array of field values
+ * @param {*} conditionValue - Value to compare against
+ * @param {String} operator - Comparison operator
+ * @returns {Boolean}
*/
evaluateArrayCondition: function evaluateArrayCondition(fieldArray, conditionValue, operator) {
if (!Array.isArray(fieldArray) || fieldArray.length === 0) {
@@ -5476,10 +5476,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
return false;
}
},
- /**
- * Check if a value is empty.
- * @param {*} value - Value to check
- * @returns {Boolean}
+ /**
+ * Check if a value is empty.
+ * @param {*} value - Value to check
+ * @returns {Boolean}
*/
isEmpty: function isEmpty(value) {
if (value === null || value === undefined) {
diff --git a/assets/js/range-slider.js b/assets/js/range-slider.js
index cd6a581ef..3f818adfe 100644
--- a/assets/js/range-slider.js
+++ b/assets/js/range-slider.js
@@ -565,8 +565,7 @@ __webpack_require__.r(__webpack_exports__);
- The provided value for the option;
- A reference to the options object;
- The name for the option;
-
- The testing function returns false when an error is detected,
+ The testing function returns false when an error is detected,
or true when everything is OK. It can also modify the option
object, to make sure all values can be correctly looped elsewhere. */
//region Defaults
diff --git a/assets/js/search-form.js b/assets/js/search-form.js
index 58d5ea05f..d05aa10b4 100644
--- a/assets/js/search-form.js
+++ b/assets/js/search-form.js
@@ -1313,6 +1313,25 @@ function getFieldValue(fieldKey, $) {
}
return null;
}
+
+ // Special handling for custom button fields.
+ // Button fields store values in nested keys: field_key[button_text], field_key[button_url_label].
+ if (fieldKey && typeof fieldKey === 'string') {
+ var normalizedButtonFieldKey = fieldKey.trim();
+ if (normalizedButtonFieldKey) {
+ var buttonTextId = (0,_field_mapping_js__WEBPACK_IMPORTED_MODULE_1__.escapeCssId)("".concat(normalizedButtonFieldKey, "_text"));
+ var buttonUrlId = (0,_field_mapping_js__WEBPACK_IMPORTED_MODULE_1__.escapeCssId)("".concat(normalizedButtonFieldKey, "_link"));
+ var $buttonTextField = $("[name=\"".concat(normalizedButtonFieldKey, "[button_text]\"], #").concat(buttonTextId)).first();
+ var $buttonUrlField = $("[name=\"".concat(normalizedButtonFieldKey, "[button_url_label]\"], #").concat(buttonUrlId)).first();
+ if ($buttonTextField.length || $buttonUrlField.length) {
+ var buttonTextValue = $buttonTextField.length ? String($buttonTextField.val() || '').trim() : '';
+ var buttonUrlValue = $buttonUrlField.length ? String($buttonUrlField.val() || '').trim() : '';
+
+ // Prefer button text for direct comparisons; fallback to URL.
+ return buttonTextValue || buttonUrlValue || null;
+ }
+ }
+ }
var $field = null;
// Handle category, tag, and location fields
diff --git a/assets/src/js/admin/vue/mixins/form-fields/conditional-logic-field.js b/assets/src/js/admin/vue/mixins/form-fields/conditional-logic-field.js
index acf2715cf..780e82718 100644
--- a/assets/src/js/admin/vue/mixins/form-fields/conditional-logic-field.js
+++ b/assets/src/js/admin/vue/mixins/form-fields/conditional-logic-field.js
@@ -665,12 +665,7 @@ export default {
// Only include fields that can be used in conditions
// Exclude fields like conditional-logic itself and non-comparable types
// Note: date, time, and file fields are now included (they use specialized inputs)
- const excludeTypes = [
- 'conditional-logic',
- 'button',
- 'submit',
- 'section',
- ];
+ const excludeTypes = ['conditional-logic', 'submit', 'section'];
if (excludeTypes.includes(type)) {
continue;
}
diff --git a/assets/src/js/global/components/conditional-logic/get-field-value.js b/assets/src/js/global/components/conditional-logic/get-field-value.js
index 613de2b8a..dd60a1b6b 100644
--- a/assets/src/js/global/components/conditional-logic/get-field-value.js
+++ b/assets/src/js/global/components/conditional-logic/get-field-value.js
@@ -46,6 +46,34 @@ export function getFieldValue(fieldKey, $) {
return null;
}
+ // Special handling for custom button fields.
+ // Button fields store values in nested keys: field_key[button_text], field_key[button_url_label].
+ if (fieldKey && typeof fieldKey === 'string') {
+ const normalizedButtonFieldKey = fieldKey.trim();
+ if (normalizedButtonFieldKey) {
+ const buttonTextId = escapeCssId(`${normalizedButtonFieldKey}_text`);
+ const buttonUrlId = escapeCssId(`${normalizedButtonFieldKey}_link`);
+ const $buttonTextField = $(
+ `[name="${normalizedButtonFieldKey}[button_text]"], #${buttonTextId}`
+ ).first();
+ const $buttonUrlField = $(
+ `[name="${normalizedButtonFieldKey}[button_url_label]"], #${buttonUrlId}`
+ ).first();
+
+ if ($buttonTextField.length || $buttonUrlField.length) {
+ const buttonTextValue = $buttonTextField.length
+ ? String($buttonTextField.val() || '').trim()
+ : '';
+ const buttonUrlValue = $buttonUrlField.length
+ ? String($buttonUrlField.val() || '').trim()
+ : '';
+
+ // Prefer button text for direct comparisons; fallback to URL.
+ return buttonTextValue || buttonUrlValue || null;
+ }
+ }
+ }
+
let $field = null;
// Handle category, tag, and location fields
diff --git a/package.json b/package.json
index 1af2d9885..d75f979eb 100644
--- a/package.json
+++ b/package.json
@@ -12,11 +12,10 @@
},
"lint-staged": {
"*.{css,scss,js}": [
- "yarn format",
- "git add"
+
],
"*.php": [
- "composer format"
+
]
},
"repository": {
From a0f63da06de1860b0f1ab4b3cefaf8e4b319a8fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rabbi=20Islam=20Rony=20=E2=9A=A1=EF=B8=8F?=
<35329385+RabbiIslamRony@users.noreply.github.com>
Date: Sun, 1 Mar 2026 10:49:01 +0600
Subject: [PATCH 3/3] package restore
---
package.json | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index d75f979eb..1af2d9885 100644
--- a/package.json
+++ b/package.json
@@ -12,10 +12,11 @@
},
"lint-staged": {
"*.{css,scss,js}": [
-
+ "yarn format",
+ "git add"
],
"*.php": [
-
+ "composer format"
]
},
"repository": {