钩子文档

pub_priv_sql_capability

💡 云策文档标注

概述

pub_priv_sql_capability 是一个已弃用的过滤器,用于在生成按作者获取自定义文章类型的私有文章 SQL 时,过滤读取私有文章的权限。

关键要点

  • 过滤器名称:pub_priv_sql_capability
  • 用途:在 get_posts_by_author_sql() 函数中,过滤自定义文章类型读取私有文章的权限能力
  • 状态:自 WordPress 3.2.0 版本起已弃用,被描述为“完全无用”
  • 参数:$capstringCapability(权限字符串)
  • 相关函数:get_posts_by_author_sql(),位于 wp-includes/post.php

代码示例

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

注意事项

  • 此过滤器在 WordPress 2.2.0 版本引入,但在 3.2.0 版本被弃用,建议开发者避免使用,因为它已不再有效或必要。

📄 原文内容

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

Parameters

$capstring
Capability.

Source

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

Changelog

Version Description
3.2.0 Deprecated. The hook transitioned from “somewhat useless” to “totally useless”.
2.2.0 Introduced.