Created
February 19, 2018 18:31
-
-
Save albionselimaj/bc926cbf4ff5f442c91fcc97845a72f6 to your computer and use it in GitHub Desktop.
Display expired listings in search results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display Expired listings in search results | |
add_filter( 'get_job_listings_query_args', function( $args ) { | |
$args['post_status'] = [ 'publish', 'expired' ]; | |
return $args; | |
}, 100 ); | |
// Make Expired listings content public | |
add_action( 'init', function() { | |
global $wp_post_statuses; | |
if ( is_array( $wp_post_statuses ) && ! empty( $wp_post_statuses['expired'] ) ) { | |
$wp_post_statuses['expired']->public = true; | |
} | |
}, 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment