Technical Docs

Search Documentation

Function: tribe_post_exists

Checks if a post, optionally of a specific type, exists in the database.

Located at src/functions/utils.php (Line: 409)


This is a low-level database check that will ignore caches and will check if there is an entry, in the posts table, for the post.

Parameters summary

(string|int) $post_id_or_name Either a post ID or a post name.
(null) $post_type An optional post type, or a list of post types, the post should have; a logic OR will be used.

Return value summary

(bool) The matching post ID if found, <code>false</code> otherwise
(int) The matching post ID if found, <code>false</code> otherwise


bool|int tribe_post_exists ( string|int $post_id_or_name, null $post_type = null )