PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 7.2.1
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v7.2.1
7.2.1 7.2 7.1.2 7.1.1 7.1 7.0.4 7.0.6 7.0.7 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 6.3.1 trunk 5.7.3 5.7.5 5.8.1 5.8.2 5.8.3 5.8.4 5.8.6 6.0.4 6.0.5 All 36 releases
mlsimport / templates / card-v3.php

card-v3.php in MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings 7.2.1, at templates/card-v3.php

59 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Standalone listing card — v3 (image with overlaid price/address). Theme-
4 * overridable: copy to your theme's mlsimport/card-v3.php. Receives:
5 * $post WP_Post The listing post.
6 * $row object|null The mlsimport_listings row (searchable scalars).
7 *
8 * Same data + action slots as v1 (mlsimport_card_view); a full-bleed overlay layout.
9 *
10 * @package Mlsimport
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 // Build the flattened card view model (same shape as v1); v3 overlays text on a full-bleed image.
18 $mli = mlsimport_card_view( $post, $row );
19 ?>
20 <article class="mlsimport-listing-card mlsimport-listing-card--v3" data-id="<?php echo esc_attr( (string) $mli['id'] ); ?>">
21 <?php
22 // Extension slot: fires before the card link.
23 do_action( 'mlsimport_card_before', $post, $row ); ?>
24 <a class="mlsimport-listing-card__link" href="<?php echo esc_url( $mli['permalink'] ); ?>">
25 <div class="mlsimport-listing-card__media"<?php echo /* inline: attach the background image + a11y attrs only when a thumbnail exists, else nothing */ $mli['has_thumb'] ? ' role="img" aria-label="' . esc_attr( $mli['address'] ) . '" style="background-image:url(\'' . esc_url( $mli['thumb'] ) . '\')"' : ''; ?>>
26 <?php
27 // Status badge overlaid on the media, only when set.
28 if ( '' !== $mli['status'] ) : ?>
29 <span class="mlsimport-listing-card__badge"><?php echo esc_html( $mli['status'] ); ?></span>
30 <?php endif; ?>
31 <div class="mlsimport-listing-card__overlay">
32 <?php
33 // Extension slot: top of the overlaid body.
34 do_action( 'mlsimport_card_body_start', $post, $row ); ?>
35 <?php
36 // Price at the top of the overlay, only when a formatted price exists.
37 if ( '' !== $mli['price_fmt'] ) : ?>
38 <span class="mlsimport-listing-card__price"><?php echo esc_html( $mli['price_fmt'] ); ?></span>
39 <?php endif; ?>
40 <h3 class="mlsimport-listing-card__title"><?php echo esc_html( $mli['address'] ); ?></h3>
41 <?php
42 // Specs line (beds/baths/area etc.), space-dot joined, only when present.
43 if ( ! empty( $mli['specs'] ) ) : ?>
44 <p class="mlsimport-listing-card__specs"><?php echo esc_html( implode( ' · ', $mli['specs'] ) ); ?></p>
45 <?php endif; ?>
46 <?php
47 // Extension slot: bottom of the overlaid body.
48 do_action( 'mlsimport_card_body_end', $post, $row ); ?>
49 </div>
50 </div>
51 </a>
52 <?php
53 // Extension slot: after the media/link (outside the anchor).
54 do_action( 'mlsimport_card_after_media', $post, $row ); ?>
55 <?php
56 // Extension slot: after the whole card.
57 do_action( 'mlsimport_card_after', $post, $row ); ?>
58 </article>
59