| 1 |
<?php |
| 2 |
/** |
| 3 |
* Standalone (theme_id 990) hook reference — the single place to discover the |
| 4 |
* extension contract, mirroring WooCommerce's wc-template-hooks.php. |
| 5 |
* |
| 6 |
* This file is documentation-only: it declares no callbacks. The hooks below |
| 7 |
* are fired/applied at the architecture's single chokepoints (the section |
| 8 |
* dispatcher, the template loader, the query executor, the render orchestrator, |
| 9 |
* the write adapter, the lead endpoint, CPT registration), so one add_action()/ |
| 10 |
* add_filter() reaches every front-end surface. Convention is locked in |
| 11 |
* docs/adr/0006-standalone-hook-conventions.md; the full human reference with |
| 12 |
* worked examples lives in docs/standalone-hooks.md. |
| 13 |
* |
| 14 |
* Conventions (see ADR-0006): |
| 15 |
* - Every hook is prefixed `mlsimport_`. |
| 16 |
* - Filters: the subject is arg 0 and MUST be returned (possibly modified); |
| 17 |
* context args ($slug, $id, $args, $params, $property) follow. |
| 18 |
* - Actions: most-relevant subject first; never expected to return. |
| 19 |
* - Dynamic hooks use the sanitized slug, e.g. `mlsimport_section_{$slug}_html`. |
| 20 |
* - Hooks are a public API: renames require a *_deprecated shim. |
| 21 |
* - SQL-affecting filters expose structured params/results as the primary path; |
| 22 |
* `mlsimport_listings_query_where` and `mlsimport_listings_order` are advanced |
| 23 |
* hooks, re-validated for placeholder safety after the filter runs. |
| 24 |
* - Editorial protection: no hook may set/clear the mlsimport_label taxonomy. |
| 25 |
* |
| 26 |
* ─── RENDER — section dispatcher (property-section-registry.php) ────────────── |
| 27 |
* filter mlsimport_property_sections ( array $sections ) |
| 28 |
* filter mlsimport_section_args ( array $args, string $slug, int $id ) |
| 29 |
* action mlsimport_before_section ( string $slug, int $id, array $args ) buffered |
| 30 |
* action mlsimport_before_section_{$slug} ( int $id, array $args ) buffered |
| 31 |
* filter mlsimport_section_{$slug}_html ( string $html, int $id, array $args ) |
| 32 |
* filter mlsimport_section_html ( string $html, string $slug, int $id, array $args ) |
| 33 |
* action mlsimport_after_section_{$slug} ( int $id, array $args ) buffered |
| 34 |
* action mlsimport_after_section ( string $slug, int $id, array $args ) buffered |
| 35 |
* |
| 36 |
* ─── RENDER — view model + facts (property-sections.php) ────────────────────── |
| 37 |
* filter mlsimport_property_data ( array $vm, int $id ) |
| 38 |
* filter mlsimport_property_field_section ( string $section, string $field ) move a RESO field between sections |
| 39 |
* filter mlsimport_format_price ( string $string, mixed $value ) |
| 40 |
* |
| 41 |
* ─── RENDER — orchestrator (class-mlsimport-standalone-render.php) ──────────── |
| 42 |
* filter mlsimport_render_args ( array $args ) |
| 43 |
* filter mlsimport_prepared_listings ( array $payload, array $args ) |
| 44 |
* action mlsimport_before_listings ( array $args, int $total ) |
| 45 |
* action mlsimport_before_search_form ( array $args ) |
| 46 |
* action mlsimport_after_search_form ( array $args ) |
| 47 |
* filter mlsimport_listings_visible_fields ( array|null $keys, array $args ) null = show every search field |
| 48 |
* action mlsimport_before_results ( array $args, int $total ) |
| 49 |
* action mlsimport_after_results ( array $args, int $total ) |
| 50 |
* filter mlsimport_no_results_message ( string $html, array $args ) |
| 51 |
* action mlsimport_before_listing_card ( WP_Post $post, object|null $row ) buffered |
| 52 |
* action mlsimport_after_listing_card ( WP_Post $post, object|null $row ) buffered |
| 53 |
* filter mlsimport_listing_card_html ( string $html, WP_Post $post, object|null $row ) |
| 54 |
* filter mlsimport_card_template ( string $name, string $style ) v1|v2|v3 → template file |
| 55 |
* filter mlsimport_card_view ( array $view, WP_Post $post, object|null $row ) |
| 56 |
* action mlsimport_card_before ( WP_Post $post, object|null $row ) inside the card |
| 57 |
* action mlsimport_card_after_media ( WP_Post $post, object|null $row ) inside the card |
| 58 |
* action mlsimport_card_body_start ( WP_Post $post, object|null $row ) inside the card |
| 59 |
* action mlsimport_card_body_end ( WP_Post $post, object|null $row ) inside the card |
| 60 |
* action mlsimport_card_after ( WP_Post $post, object|null $row ) inside the card |
| 61 |
* filter mlsimport_map_markers ( array $markers, array $args ) |
| 62 |
* |
| 63 |
* ─── RENDER — page-block dispatcher (page-block-registry.php) ───────────────── |
| 64 |
* filter mlsimport_page_blocks ( array $blocks ) |
| 65 |
* filter mlsimport_page_block_args ( array $args, string $slug ) |
| 66 |
* action mlsimport_before_page_block ( string $slug, array $args ) buffered |
| 67 |
* action mlsimport_before_page_block_{$slug} ( array $args ) buffered |
| 68 |
* filter mlsimport_page_block_{$slug}_html ( string $html, array $args ) |
| 69 |
* filter mlsimport_page_block_html ( string $html, string $slug, array $args ) |
| 70 |
* action mlsimport_after_page_block_{$slug} ( array $args ) buffered |
| 71 |
* action mlsimport_after_page_block ( string $slug, array $args ) buffered |
| 72 |
* filter mlsimport_search_form_fields ( array $rows, array $args ) each row: { field, label } |
| 73 |
* filter mlsimport_contact_form_fields ( array $rows, array $args ) each row: { name, type, label, placeholder, required } |
| 74 |
* |
| 75 |
* ─── QUERY — executor + builder (class-mlsimport-standalone-listings-query / -query) ── |
| 76 |
* filter mlsimport_listings_query_params ( array $params ) |
| 77 |
* filter mlsimport_listings_query_where ( array $where{where,args}, array $params ) advanced |
| 78 |
* filter mlsimport_listings_feature_ttids ( int[] $ttids, array $params ) |
| 79 |
* filter mlsimport_listings_results ( array $result{rows,total}, array $params ) |
| 80 |
* filter mlsimport_listings_order ( string $order, array $params ) advanced, re-validated |
| 81 |
* filter mlsimport_listings_per_page ( int $limit, array $params ) |
| 82 |
* |
| 83 |
* ─── TEMPLATE — loader + routing + slots (template loader / single / templates) ── |
| 84 |
* filter mlsimport_template_name ( string $name ) |
| 85 |
* filter mlsimport_template_subdir ( string $subdir ) |
| 86 |
* filter mlsimport_locate_template ( string $path, string $name, string $subdir ) |
| 87 |
* filter mlsimport_template_include ( string $located, string $template ) |
| 88 |
* filter mlsimport_single_property_sections ( string[] $slugs, int $id ) single-page section order |
| 89 |
* action mlsimport_before_single_property ( int $id ) |
| 90 |
* action mlsimport_after_single_property ( int $id ) |
| 91 |
* action mlsimport_before_archive ( array $args ) |
| 92 |
* action mlsimport_after_archive ( array $args ) |
| 93 |
* |
| 94 |
* ─── ASSETS / MAP (class-mlsimport-standalone-assets / -settings / property-sections) ── |
| 95 |
* filter mlsimport_standalone_styles ( bool $enqueue ) stylesheet toggle |
| 96 |
* filter mlsimport_map_tile_url ( string $url ) |
| 97 |
* |
| 98 |
* ─── LIFECYCLE — import write (StandaloneClass.php, row, reso-map, reindex) ──── |
| 99 |
* action mlsimport_before_save_property ( int $property_id, array $property ) |
| 100 |
* filter mlsimport_property_skip_write ( bool $skip, int $property_id, string $incoming_mod, array $property ) |
| 101 |
* filter mlsimport_property_meta_value ( mixed $value, string $meta_key, int $property_id, array $property ) |
| 102 |
* filter mlsimport_property_feature_label ( string $label, string $reso_field, mixed $value ) |
| 103 |
* filter mlsimport_property_post_content ( string $content, array $property ) |
| 104 |
* action mlsimport_after_save_property ( int $property_id, array $property ) |
| 105 |
* filter mlsimport_reso_targets_for ( array $targets, string $field ) |
| 106 |
* filter mlsimport_listings_row ( array $row, int $post_id, string $listing_key ) |
| 107 |
* action mlsimport_after_listings_row_upsert ( int $post_id, string $listing_key, array $row ) |
| 108 |
* action mlsimport_before_delete_listing_row ( int $post_id ) |
| 109 |
* action mlsimport_after_delete_listing_row ( int $post_id ) |
| 110 |
* action mlsimport_reindex_property ( int $post_id ) |
| 111 |
* action mlsimport_after_reindex ( int $count ) |
| 112 |
* |
| 113 |
* ─── LEAD (class-mlsimport-property-lead.php, property-sections.php) ────────── |
| 114 |
* filter mlsimport_property_lead_fields ( string $fields, string $variant, int $id ) |
| 115 |
* filter mlsimport_property_lead_validation ( array $errors, array $input, int $property_id ) |
| 116 |
* filter mlsimport_property_lead_subject ( string $subject, int $property_id ) |
| 117 |
* filter mlsimport_property_lead_email_body ( string $body, array $data, int $property_id ) |
| 118 |
* action mlsimport_property_lead_submitted ( array $data, int $property_id ) |
| 119 |
* action mlsimport_property_lead_mail_sent ( bool $sent, array $data, int $property_id ) |
| 120 |
* filter mlsimport_property_lead_recipient ( string $to, int $property_id ) |
| 121 |
* |
| 122 |
* ─── LIVE MODE — store-nothing passthrough seams (includes/live/) ───────────── |
| 123 |
* filter mlsimport_live_mode_active ( bool $active ) the one gate |
| 124 |
* filter mlsimport_live_cache_ttl ( int $ttl ) seconds |
| 125 |
* filter mlsimport_live_url_base ( string $base ) virtual single URL base ('listing') |
| 126 |
* filter mlsimport_property_data_pre ( array|null $pre, int $id ) short-circuit the single VM |
| 127 |
* filter mlsimport_map_payload_pre ( array|null $pre, array $args, int $zoom ) short-circuit the viewport payload |
| 128 |
* filter mlsimport_map_bounds_pre ( array|null $pre, array $params ) short-circuit the overall map bounds |
| 129 |
* filter mlsimport_search_field_options ( array $pairs, array $def ) value => label option list |
| 130 |
* filter mlsimport_search_field_options_pre ( array|null $pre, array $def ) options before terms query (live enums) |
| 131 |
* filter mlsimport_page_block_list_by_id_pre ( string|null $pre, array $args ) List-by-ID as ListingKeys |
| 132 |
* filter mlsimport_page_block_ids_cards_pre ( string|null $pre, array $args, string $slide_class ) list/slider ids as ListingKeys |
| 133 |
* filter mlsimport_page_block_featured_card_pre ( string|null $pre, array $args ) Featured card by ListingKey |
| 134 |
* filter mlsimport_page_block_map_markers_pre ( array|null $pre, array $args ) Map ids as ListingKey markers |
| 135 |
* filter mlsimport_half_map_draw_tools ( bool $enabled ) draw-area tools gate (live hides) |
| 136 |
* |
| 137 |
* ─── REGISTRATION (class-mlsimport-standalone-cpt.php) ──────────────────────── |
| 138 |
* filter mlsimport_property_post_type_args ( array $args ) |
| 139 |
* filter mlsimport_agent_post_type_args ( array $args ) |
| 140 |
* filter mlsimport_taxonomies ( array $list ) |
| 141 |
* filter mlsimport_taxonomy_args ( array $args, string $taxonomy ) |
| 142 |
* action mlsimport_registered_cpts ( ) |
| 143 |
* |
| 144 |
* @package Mlsimport |
| 145 |
*/ |
| 146 |
|
| 147 |
if ( ! defined( 'ABSPATH' ) ) { |
| 148 |
exit; |
| 149 |
} |
| 150 |
|