Fix property filters AJAX: correct script handle for wp_localize_script

Changed 'homeproz-main' to 'homeproz-script' so homeprozAjax variable
is actually attached to the correct script and available on the page.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hanson.xyz Dev
2025-11-30 19:40:36 -06:00
parent 1344d994be
commit cefcd0f98d
4 changed files with 3 additions and 40 deletions
@@ -54,14 +54,6 @@ $agent_count = count($agents_data);
<section class="agents-section"> <section class="agents-section">
<div class="container"> <div class="container">
<!-- Page intro -->
<div class="page-intro">
<p class="page-intro-text">Meet the dedicated professionals ready to help you find your perfect property. Our experienced team is here to guide you through every step of your real estate journey.</p>
<?php if ($agent_count > 0) : ?>
<p class="page-intro-count"><?php echo $agent_count; ?> Agent<?php echo $agent_count !== 1 ? 's' : ''; ?></p>
<?php endif; ?>
</div>
<?php if (!empty($agents_data)) : ?> <?php if (!empty($agents_data)) : ?>
<div class="agents-grid"> <div class="agents-grid">
<?php foreach ($agents_data as $agent_item) : <?php foreach ($agents_data as $agent_item) :
File diff suppressed because one or more lines are too long
@@ -221,7 +221,7 @@ add_action('wp_ajax_nopriv_homeproz_filter_properties', 'homeproz_ajax_filter_pr
*/ */
function homeproz_localize_ajax_data() { function homeproz_localize_ajax_data() {
if (is_post_type_archive('property') || is_tax('property_type') || is_tax('property_status') || is_tax('property_location')) { if (is_post_type_archive('property') || is_tax('property_type') || is_tax('property_status') || is_tax('property_location')) {
wp_localize_script('homeproz-main', 'homeprozAjax', array( wp_localize_script('homeproz-script', 'homeprozAjax', array(
'ajaxUrl' => admin_url('admin-ajax.php'), 'ajaxUrl' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('homeproz_filter_nonce'), 'nonce' => wp_create_nonce('homeproz_filter_nonce'),
'archiveUrl' => get_post_type_archive_link('property'), 'archiveUrl' => get_post_type_archive_link('property'),
@@ -6,36 +6,7 @@
.Agents_Archive { .Agents_Archive {
.agents-section { .agents-section {
padding: 4rem 0; padding: 3rem 0 4rem;
}
// Page Intro
.page-intro {
text-align: center;
max-width: 700px;
margin: 0 auto 3rem;
padding-bottom: 2rem;
border-bottom: 1px solid var(--color-border);
}
.page-intro-text {
font-size: 1rem;
color: var(--color-text-muted);
line-height: 1.6;
margin-bottom: 1rem;
@media (min-width: 768px) {
font-size: 1.125rem;
}
}
.page-intro-count {
font-size: 0.875rem;
color: var(--color-accent);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0;
} }
// Agents Grid // Agents Grid