MHM Rentiva v4.26.6: Vehicles Grid Shortcode Review Fixes
v4.26.6 is the product of a shortcode review session during YouTube stream preparation. Accumulated silent bugs in the rentiva_vehicles_grid and rentiva_featured_vehicles shortcodes have been resolved, and two new features — view_all_url and a service type badge — have been added.
🔧 Vehicles Grid: Price Sort Fix
The sort_by="price" option had not been working correctly for some time. Root cause: the named meta_query clause approach used alongside the vehicle availability filter was generating incorrect SQL ordering.
Fix: Switched to WordPress's standard meta_key + meta_value_num pattern.
if ( $orderby_key === 'price' ) {
$args['meta_key'] = MetaKeys::VEHICLE_PRICE_PER_DAY;
$args['orderby'] = 'meta_value_num';
$args['order'] = $sort_order;
}
Both ascending and descending sort were verified via WP-CLI.
⚡ Cache Logic Repaired
Two silent cache bugs:
- Always disabled — The condition logic had an inverted check. Cache is now active in production.
- Cleared on every
wp_headcall — Invalidation now fires only when a vehicle is saved or deleted.
🧹 Orderby Injection Removed from 9 Blocks
Nine Gutenberg blocks were silently overriding the sort_by attribute from the CAM pipeline with orderby=title, order=ASC defaults on every render. Those defaults have been removed.
✨ New: "View All" Link
The view_all_url and view_all_text attributes have been added. Supported in the block editor, Elementor, and classic shortcode.
[rentiva_vehicles_grid view_all_url="/araclar/" view_all_text="Tüm Araçları Gör"]
Renders as a properly aligned button in the section footer.
🏷️ New: Service Type Badge
Vehicle cards now display a badge based on the _rentiva_vehicle_service_type meta value:
- Transfer Only — blue badge
- Transfer + Rental — green badge
- Standard rental vehicles show no badge.
🚫 Featured Vehicles: Init Flash Fixed
Raw flex markup was visible before Swiper initialized (5 vehicles horizontal → 3-column slider). Fix: opacity:0 + CSS transition.
.mhm-featured-swiper {
transition: opacity 0.2s ease;
}
.mhm-featured-swiper:not(.swiper-initialized) {
opacity: 0;
pointer-events: none;
}
Layout space is preserved (zero CLS); once Swiper is ready, it fades in with a 0.2s transition.
🔧 Other Fixes
show_book_buttondead attribute: Featured Vehicles and the Elementor widget were sending this key, but the template only checkedshow_booking_button. Both keys are now accepted.- Search Results
default_sort: Now applied when no sort parameter is present in the URL. - Unified Search luggage tooltip: A hover/focus tooltip has been added for the luggage capacity field.
Next: v4.26.7/v4.26.8 — Popular Routes shortcode and Swiper loop mode fix.
