Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_usernumposts

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
118  * @uses $wpdb WordPress database object for queries.
119  *
120  * @param int $userid User ID.
121  * @return int Amount of posts user has written.
122  */
123 function get_usernumposts($userid) {
124      global $wpdb;
125      $userid = (int) $userid;
126      $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post'));
127      return apply_filters('get_usernumposts', $count, $userid);
128 }
129
130 /**
131  * Check that the user login name and password is correct.
132  *
133  * @since 0.71
134  * @todo xmlrpc only. Maybe move to xmlrpc.php.
135  *
136  * @param string $user_login User name.