WordPress at Your Fingertips
function is not described

_draft_or_post_title() WP 2.7.0

Get the post title.

The post title is fetched and if it is blank then a default string is returned.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

String. The post title if set.

Usage

_draft_or_post_title( $post );
$post(int|WP_Post)
Post ID or WP_Post object.
Default: global $post

Changelog

Since 2.7.0 Introduced.

Code of _draft_or_post_title() WP 5.8.2

function _draft_or_post_title( $post = 0 ) {
	$title = get_the_title( $post );
	if ( empty( $title ) ) {
		$title = __( '(no title)' );
	}
	return esc_html( $title );
}