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 |
---|---|
5259 | /** |
5260 | * Filter the capability to read private posts for a custom post type |
5261 | * when generating SQL for getting posts by author. |
5262 | * |
5263 | * @since 2.2.0 |
5264 | * @deprecated 3.2.0 The hook transitioned from "somewhat useless" to "totally useless". |
5265 | * |
5266 | * @param string $cap Capability. |
5267 | */ |
5268 | if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) { |
5269 | $cap = $post_type_obj->cap->read_private_posts; |
5270 | } |
5271 |
|
5272 | if ( $full ) { |
5273 | if ( null === $post_author ) { |
5274 | $sql = $wpdb->prepare( 'WHERE post_type = %s AND ', $post_type ); |
5275 | } else { |
5276 | $sql = $wpdb->prepare( 'WHERE post_author = %d AND post_type = %s AND ', $post_author, $post_type ); |
5277 | } |