Title: pub_priv_sql_capability
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters_deprecated( ‘pub_priv_sql_capability’, string $cap )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#wp--skip-link--target)

This hook has been deprecated since 3.2.0. The hook transitioned from “somewhat 
useless” to “totally useless” instead.

Filters the capability to read private posts for a custom post type when generating
SQL for getting posts by author.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#parameters)󠁿

 `$cap`string

Capability.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#source)󠁿

    ```php
    $cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/post.php#L7481)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/post.php#L7481-L7481)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#related)󠁿

| Used by | Description | 
| [get_posts_by_author_sql()](https://developer.wordpress.org/reference/functions/get_posts_by_author_sql/)`wp-includes/post.php` |

Retrieves the post SQL based on capability, author, and type.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/pub_priv_sql_capability/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.2.0](https://developer.wordpress.org/reference/since/3.2.0/) | Deprecated. The hook transitioned from "somewhat useless" to "totally useless". | 
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpub_priv_sql_capability%2F)
before being able to contribute a note or feedback.