epl_hide_listing_statuses filter: Allow off market (offmarket) or withdrawn listings to display

Description #

Decides which listing statuses are hidden from your website. By default withdrawn, offmarket (Off Market) and deleted listings are hidden. Use this filter to show some of them, for example off market listings.

From 3.6 hidden listings are left out of the listing archives, search results, shortcodes and widgets in the query, not only when each listing is shown. Pages show a full set of listings and the page counts are right.


Usage #

add_filter( 'epl_hide_listing_statuses', 'my_function' );

Parameters #

$statuses (array)
The statuses to hide. Default array( 'withdrawn', 'offmarket', 'deleted' ). Return an empty array to show every status.


Examples #

Show off market listings (hide only withdrawn and deleted)

function my_allow_epl_off_market( $statuses ) {
	return array( 'withdrawn', 'deleted' );
}
add_filter( 'epl_hide_listing_statuses', 'my_allow_epl_off_market' );

Add it to your theme's functions.php or a custom plugin.


Where hidden listings are left out (3.6) #

  • Listing archives, search results, and location, feature and business category pages.
  • Every EPL listing shortcode, the EPL widgets, and Elementor Pro Loop Grids that use an EPL Loop Item.

Not in wp-admin, not on a single listing's own page, and not in other plugins' queries (an importer looking up a listing still finds it). To add your own query, see epl_is_front_end_listing_query.


Related functions (3.6) #

  • epl_hide_listing_statuses(): returns the hidden statuses, after this filter.
  • epl_get_hidden_listing_ids(): the IDs of listings with a hidden status. Kept in the listing search cache until a listing changes, so excluding them is fast even on 100,000 listings.
  • epl_is_front_end_listing_query( $query ): is this one of EPL's own front end listing queries? Filter: epl_is_front_end_listing_query.
  • epl_exclude_hidden_listing_statuses( $query ): runs on pre_get_posts and adds the hidden IDs to post__not_in on those queries.

Source #

lib/includes/template-functions.php, in epl_hide_listing_statuses().


Changelog #

  • 3.1.20 Introduced.
  • 3.4.45 The deleted status is hidden by default.
  • 3.6 Hidden listings are left out of the query, not just the display.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.