-
-
Save billerickson/5104faa2b1194948783e68fdf8da2240 to your computer and use it in GitHub Desktop.
This file contains 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 id="current" | |
* @see https://displayposts.com/2019/04/24/display-current-post/ | |
* | |
*/ | |
function be_dps_current_post( $args, $atts ) { | |
if( !empty( $atts['id'] ) && 'current' == $atts['id'] ) | |
$args['post__in'] = array( get_the_ID() ); | |
return $args; | |
} | |
add_filter( 'display_posts_shortcode_args', 'be_dps_current_post', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment