-
-
Save billerickson/a47e6b0c767e1fcc2235932cc6d6aed0 to your computer and use it in GitHub Desktop.
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 Posts, add support for s="current" | |
* @see https://displayposts.com/2024/07/30/display-the-current-search-results/ | |
* | |
*/ | |
function be_dps_current_search( $args, $atts ) { | |
if( !empty( $atts['s'] ) && 'current' == $atts['s'] ) { | |
$args['s'] = get_search_query(); | |
} | |
return $args; | |
} | |
add_filter( 'display_posts_shortcode_args', 'be_dps_current_search', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment