WPDev.one
Core Function
View Source on Trac ↗

post_exists()

post_exists( mixed $title, mixed $content = '', mixed $date = '', mixed $type = '', mixed $status = '' )

Determines if a post exists based on title, content, date and type.

Parameters 1 required

Name / Type Description
$title
string

Post title.

Required
$content
string

Optional. Post content.

$date
string

Optional. Post date.

$type
string

Optional. Post type.

$status
string

Optional. Post status.

Return Value

(int)
Post ID if post exists, 0 otherwise.

Function Information

Since Version
2.0.0
Source File
wp-admin/includes/post.php
Advertisement