_draft_or_post_title

Definition:
function _draft_or_post_title( $post_id = 0 ) {}

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

Parameters

  • int $post_id: The post id. If not supplied the global $post is used.

Return values

returns:The post title if set

Source code

function _draft_or_post_title( $post_id = 0 ) {

	$title = get_the_title($post_id);

	if ( empty($title) )

		$title = __('(no title)');

	return $title;

}

4307

No comments yet... Be the first to leave a reply!

Leave a comment