Rentiva v4.34.1 — Popular Routes Clickable Cards
A small but high-leverage patch on top of v4.34.0. Popular Routes cards are now clickable, and clicking one deep-links into the transfer-search form with origin and destination pre-filled. The visitor's path goes from "see a route I want → find the search form → re-pick the same locations from a dropdown of seven → add date/time → submit" down to "click the route → add date/time → submit."
Why
A reviewer flagged the obvious gap right after v4.34.0 shipped: the cards looked like CTAs but weren't tappable. A user seeing "İstanbul Havalimanı → Taksim · ₺850" on the homepage instinctively reaches for the card, not the search form three sections down. v4.34.0 left them with a static information panel; v4.34.1 turns it into the conversion surface it should have been.
What changed
Whole-card click target
PopularRoutesShortcode::render_card now wraps the <article> in an <a class="mhm-popular-route-card-link">. The href is built with add_query_arg() against a filterable base URL (default: the same target as the section "Search transfers" link, which itself defaults to home_url('/transfer/')).
<a class="mhm-popular-route-card-link"
href="https://example.com/transfer/?origin_id=73&destination_id=76"
aria-label="Search transfers from İstanbul Havalimanı (IST) to Taksim Ofis">
<article class="mhm-popular-route-card mhm-popular-route-card--featured" role="listitem">
...
</article>
</a>
The CSS resets color: inherit; text-decoration: none on the anchor so the card visuals stay identical to v4.34.0, but adds :focus-visible { outline: 2px solid var(--mhm-pr-accent) } so keyboard navigation gets a visible focus ring without disrupting mouse users.
Deep-link pre-fill
TransferShortcodes::prepare_template_data() now reads origin_id and destination_id from $_GET (absint, sanitized) and exposes them to the template as $preselected_origin and $preselected_destination. The transfer-search.php template gained selected() calls on the <option> elements for both selects.
<option value="<?php echo esc_attr((string) $loc->id); ?>"
<?php selected(isset($preselected_origin) ? (int) $preselected_origin : 0, (int) $loc->id); ?>>
<?php echo esc_html($loc->name); ?>
</option>
Backwards compatible: installations that never get ?origin_id=... URLs behave exactly as they did in v4.34.0 (the form opens with empty selects, as before). The change is additive — no breakage, no migration.
New filter — mhm_rentiva_popular_routes_search_url
The card-link base URL is independently filterable from the section "Search transfers" link. Themes that route the section link to a custom landing page but want the cards to deep-link directly into the search form can do so without one filter clobbering the other.
// Card click target = transfer-search shortcode page
add_filter('mhm_rentiva_popular_routes_search_url', function () {
return home_url('/transfer-search/');
});
// Section "Search transfers" link target = a curated catalog page
add_filter('mhm_rentiva_popular_routes_view_all_url', function () {
return home_url('/all-routes/');
});
When the card filter returns empty, the link falls back to the section URL, which falls back to home_url('/transfer/') — sane defaults all the way down.
ARIA labels per card
aria-label="Search transfers from İstanbul Havalimanı (IST) to Taksim Ofis"
Screen readers announce a meaningful action when the link gets focus. Crawlers also see a real description of where the link goes, which is useful for the homepage SEO surface.
Section label rename
"View all →" → "Search transfers →" in the section header. The link has always landed on the transfer-search form (not a route catalog page), so the v4.34.0 label was misleading. The new label matches what actually happens.
A future v4.35.x release may add an actual route-catalog page (e.g. /transfer-routes/ rendering all eligible routes in list form), at which point the "View all" label could come back honestly. For now: truth in advertising.
Tests
- PHPUnit: 837 → 840 (+3). New tests assert the anchor wrapper exists with the right CSS class, the href carries both
origin_idanddestination_idquery parameters, themhm_rentiva_popular_routes_search_urlfilter overrides the base URL, and the section header label has been renamed. - PHPCS: 0 errors.
- Runtime smoke test (Chrome DevTools MCP): rendered 6 cards, each wrapped in an anchor with the correct query-param href and a TR
aria-label; navigating to/transfer/?origin_id=73&destination_id=76pre-selects "İstanbul Havalimanı (IST)" and "Taksim Ofis" in the form selects.
Compatibility
- No license-server upgrade.
- No breaking changes — v4.34.0 sites upgrade in place.
- Existing transfer-search submissions continue to work without
$_GETparams.
