get_private_posts_cap_sql( string|array $post_type )

Retrieve the private post SQL based on capability.


25 related functions found for: get_private_posts_cap_sql

Top ↑

Related terms found for this post

TaxonomyTerms
wp-parser-related-wordscap, capability, capabl, get, post, post-php, posts, privat, private, queri, query, sql, statu, status, wp-includes
wp-parser-packagePost, WordPress
wp-parser-source-filewp-includes/post.php

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • cap
  • capability
  • capabl
  • get
  • post
  • Post
  • post-php
  • posts
  • privat
  • private
  • queri
  • query
  • sql
  • statu
  • status
  • wp-includes
  • wp-includes/post.php

Top ↑

Description Description

This function provides a standardized way to appropriately select on the post_status of a post type. The function will return a piece of SQL code that can be added to a WHERE clause; this SQL is constructed to allow all published posts, and all private posts to which the user has access.


Top ↑

Parameters Parameters

$post_type

(string|array) (Required) Single post type or an array of post types. Currently only supports 'post' or 'page'.


Top ↑

Return Return

(string) SQL code that can be added to a where clause.


Top ↑

Source Source

File: wp-includes/post.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.3.0 Added the ability to pass an array to $post_type.
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.