Un motore di ricerca WordPress per sviluppatori e autori di temi



_draft_or_post_title ›

Da2.7.0
Deprecaton/a
_draft_or_post_title ( $post = 0 )
Parametri:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global $post.
    Richiesto: No
    Default:
Ritorna:
  • (string) The post title if set.
Definito a:
Codex:

Get the post title.

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



Sorgenti

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