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 |
---|---|
5548 | /** |
5549 | * Filters the capability to read private posts for a custom post type |
5550 | * when generating SQL for getting posts by author. |
5551 | * |
5552 | * @since 2.2.0 |
5553 | * @deprecated 3.2.0 The hook transitioned from "somewhat useless" to "totally useless". |
5554 | * |
5555 | * @param string $cap Capability. |
5556 | */ |
5557 | if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) { |
5558 | $cap = current_user_can( $post_type_obj->cap->read_private_posts ); |
5559 | } |
5560 |
|
5561 | // Only need to check the cap if $public_only is false. |
5562 | $post_status_sql = "post_status = 'publish'"; |
5563 | if ( false === $public_only ) { |
5564 | if ( $cap ) { |
5565 | // Does the user have the capability to view private posts? Guess so. |
5566 | $post_status_sql .= " OR post_status = 'private'"; |