JoshLewis Posted April 14, 2020 at 06:20 AM Share Posted April 14, 2020 at 06:20 AM Recently wanted to have shortcodes stripped from listing list view. Based on the docs I modified it to: /* Strip out listing list views summary shortcodes */ function list_page_replace_summary($listings, $params) { foreach ($listings as & $listing) { if ( $listing['Listing']['description'] ) { // Uncomment line below to show truncated description instead of summary in listing list view // $listing['Listing']['summary'] = $listing['Listing']['description']; $listing['Listing']['summary'] = strip_shortcodes($listing['Listing']['summary']); } } return $listings; } Clickfwd\Hook\Filter::add('post_get_listings_listpage_query', 'list_page_replace_summary', 10); This allows other neat variations such as conversions and alternative data display. Alejandro and n00bster 1 1 Link to comment
Recommended Posts