[wp-testers] incorrect post counts

]V[orlock Zernebock morlockz at gmail.com
Thu Feb 7 19:34:01 GMT 2008


My database is correct, my files are updated, but all counts are still wrong
except the one for pages.

2008/2/5, Ryan Boren <ryan at boren.nu>:
>
> On Tue, Feb 5, 2008 at 2:18 PM, ]V[orlock Zernebock <morlockz at gmail.com>
> wrote:
> > Maybe I'm too noob in PHP but I searched for "wp_count_posts" function
> >  inside "wp-includes/post.php" and I didn't find it.
>
> svn update to get it.  It's new.
>
> function wp_count_posts( $type = 'post', $status = 'publish' ) {
>         global $wpdb;
>
>         return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM
> $wpdb->posts WHERE post_type = %s AND post_status = %s", $type,
> $status) );
> }
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


More information about the wp-testers mailing list