Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

wordpress number of posts by user

echo count_user_posts(USER,'post');             // posts
echo count_user_posts(USER,'page');             // pages
echo count_user_posts(USER,'CUSTOM_POST_TYPE'); // custom post types


// Under a conditional w/ message:
if(count_user_posts(USER,'post') > 10){
	echo 'greater than';
} else {
    echo 'less than';
}
Source by codeddesign.org #
 
PREVIOUS NEXT
Tagged: #wordpress #number #posts #user
ADD COMMENT
Topic
Name
9+7 =