WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
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. |