Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions assets/js/add-listing.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 102 additions & 102 deletions assets/js/admin-multi-directory-builder.js

Large diffs are not rendered by default.

204 changes: 102 additions & 102 deletions assets/js/admin-settings-manager.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions assets/js/range-slider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions assets/js/search-form.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions templates/archive/fields/phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@
'whatsapp' => $is_whatsapp,
]
);
$phone_label = ! empty( $data['original_field']['label'] )
? $data['original_field']['label']
: ( ! empty( $data['label'] ) ? $data['label'] : $label );
?>

<?php if ( $is_action ) : ?>
<div class="directorist-listing-card-phone">
<a class="directorist-btn directorist-btn-xs directorist-btn-primary" href="<?php echo esc_url( $phone_link ); ?>">
<?php directorist_icon( $icon ); ?>
<?php echo esc_html( $data['label'] ); ?>
<?php echo esc_html( $phone_label ); ?>
</a>
</div>
<?php else : ?>
<li class="directorist-listing-card-phone">
<?php directorist_icon( $icon ); ?>
<?php $listings->print_label( $label ); ?>
<?php $listings->print_label( $phone_label ); ?>
<a href="<?php echo esc_url( $phone_link ); ?>">
<?php echo esc_html( $value ); ?>
</a>
Expand Down
8 changes: 6 additions & 2 deletions templates/single/action-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,19 @@
$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'] : '' );
?>
<a class="directorist-btn directorist-btn-sm directorist-btn-primary"
href="<?php echo esc_url( $phone_link ); ?>">
<?php directorist_icon( $phone_icon ); ?>
<?php echo esc_html( $phone_label ); ?>
</a>
<?php else :
$phone_label = ! empty( $action['form_data']['label'] ) ? $action['form_data']['label'] : __( 'Call Now', 'directorist' );
$phone_label = ! empty( $action['form_data']['label'] )
? $action['form_data']['label']
: ( ! empty( $action['label'] ) ? $action['label'] : '' );
?>
<a class="directorist-btn directorist-btn-sm directorist-btn-primary"
href="<?php echo esc_url( $phone_link ); ?>">
Expand Down