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
164  * @uses $wpdb WordPress database object for queries.
165  *
166  * @param int $userid User ID.
167  * @return int Amount of posts user has written.
168  */
169 function get_usernumposts($userid) {
170      global $wpdb;
171      $userid = (int) $userid;
172      $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'));
173      return apply_filters('get_usernumposts', $count, $userid);
174 }
175
176 /**
177  * Check that the user login name and password is correct.
178  *
179  * @since 0.71
180  * @todo xmlrpc only. Maybe move to xmlrpc.php.
181  *
182  * @param string $user_login User name.