Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_count_posts

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2374       *
2375       * @since 3.7.0
2376       *
2377       * @param object $counts An object containing the current post_type's post
2378       *                       counts by status.
2379       * @param string $type   Post type.
2380       * @param string $perm   The permission to determine if the posts are 'readable'
2381       *                       by the current user.
2382       */
2383      return apply_filters( 'wp_count_posts', $counts, $type, $perm );
2384 }
2385
2386 /**
2387  * Count number of attachments for the mime type(s).
2388  *
2389  * If you set the optional mime_type parameter, then an array will still be
2390  * returned, but will only have the item you are looking for. It does not give
2391  * you the number of attachments that are children of a post. You can get that
2392  * by counting the number of children that post has.