Created
September 14, 2013 05:20
-
-
Save danemorgan/6559017 to your computer and use it in GitHub Desktop.
Get the number of posts attributed to a specific author.
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
function count_posts_by_user($userID) { | |
$userposts = get_posts('showposts=-1&author='.$userID); | |
return count($userposts); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment