get_private_posts_cap_sql

函式
get_private_posts_cap_sql ( $post_type )
引數
  • (string|array) $post_type Single post type or an array of post types. Currently only supports 'post' or 'page'.
    Required:
返回值
  • (string) SQL code that can be added to a where clause.
定義位置
相關方法
_prime_post_cachesget_previous_posts_page_linkget_posts_by_author_sqlget_previous_posts_linkget_author_posts_url
引入
2.2.0
棄用
-

get_private_posts_cap_sql函式是一個WordPress函式,用於檢索檢索特定使用者許可權的私人文章的SQL查詢: 這個函式把許可權名稱作為引數,並返回SQL查詢。

根據許可權檢索隱私文章SQL。

這個函式提供了一個標準化的方法來適當地選擇一個文章型別的post_status: 該函式將返回一段SQL程式碼,可以新增到WHERE子句中;該SQL的構造是允許所有已釋出的文章,以及使用者可以訪問的所有私人文章。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_private_posts_cap_sql( $post_type ) {
return get_posts_by_author_sql( $post_type, false );
}
function get_private_posts_cap_sql( $post_type ) { return get_posts_by_author_sql( $post_type, false ); }
function get_private_posts_cap_sql( $post_type ) {
	return get_posts_by_author_sql( $post_type, false );
}

常見問題

FAQs
檢視更多 >