WordPress.org

Make WordPress Core

Ticket #7038: post.correction.r8008.diff

File post.correction.r8008.diff, 1.6 KB (added by santosj, 7 years ago)

Wp_count_posts() corrections based on r8008.

  • post.php

     
    11<?php 
    22/** 
    3  * Post functions and post utility function 
     3 * Post functions and post utility function. 
    44 * 
     5 * Warning: The inline documentation for the functions contained 
     6 * in this file might be inaccurate, so the documentation is not 
     7 * authoritative at the moment. 
     8 * 
    59 * @package WordPress 
    610 * @subpackage Post 
    711 * @since 1.5 
     
    751755} 
    752756 
    753757/** 
    754  * wp_count_posts() - Count number of posts with a given type 
     758 * Count number of posts of a post type and is permissible. 
    755759 * 
    756  * {@internal Missing Long Description}} 
     760 * This function provides an efficient method of finding the amount 
     761 * of post's type a blog has. Another method is to count the amount 
     762 * of items in get_posts(), but that method has a lot of overhead 
     763 * with doing so. Therefore, when developing for 2.5+, use this 
     764 * function instead. 
    757765 * 
     766 * The $perm parameter checks for 'readable' value and if the user 
     767 * can read private posts, it will display that for the user that 
     768 * is signed in. 
     769 * 
    758770 * @package WordPress 
    759771 * @subpackage Post 
    760772 * @since 2.5 
     773 * @link http://codex.wordpress.org/Template_Tags/wp_count_posts 
    761774 * 
    762  * @param string $type Post type 
    763  * @return array Number of posts for each status 
     775 * @param string $type Optional. Post type to retrieve count 
     776 * @param string $perm Optional. 'readable' or empty. 
     777 * @return object Number of posts for each status 
    764778 */ 
    765779function wp_count_posts( $type = 'post', $perm = '' ) { 
    766780        global $wpdb;