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 |
---|---|
4156 | function get_posts_by_author_sql( $post_type, $full = true, $post_author = null ) { |
4157 | global $user_ID, $wpdb; |
4158 |
|
4159 | // Private posts |
4160 | $post_type_obj = get_post_type_object( $post_type ); |
4161 | if ( ! $post_type_obj ) |
4162 | return ' 1 = 0 '; |
4163 |
|
4164 | // This hook is deprecated. Why you'd want to use it, I dunno. |
4165 | if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) |
4166 | $cap = $post_type_obj->cap->read_private_posts; |
4167 |
|
4168 | if ( $full ) { |
4169 | if ( null === $post_author ) { |
4170 | $sql = $wpdb->prepare( 'WHERE post_type = %s AND ', $post_type ); |
4171 | } else { |
4172 | $sql = $wpdb->prepare( 'WHERE post_author = %d AND post_type = %s AND ', $post_author, $post_type ); |
4173 | } |
4174 | } else { |