-
-
Save billerickson/58e50a14c596c2fa4268a6e3bda49667 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 // don't include this line | |
/** | |
* Display Posts, category by author name | |
* | |
*/ | |
function be_dps_category_author_name( $args, $atts ) { | |
if( is_user_logged_in() ) { | |
$current_user = wp_get_current_user(); | |
$got_login_name = $current_user->user_login; | |
$args['category_name'] = $got_login_name; | |
} | |
return $args; | |
} | |
add_filter( 'display_posts_shortcode_args', 'be_dps_category_author_name', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment