Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_draft_or_post_title [ WordPress Function ]

_draft_or_post_title ( $post_id = 0 )
Parameters:
  • (int) $post_id The post id. If not supplied the global $post is used.
Returns:
  • (string) The post title if set
Defined at:



Get the post title.

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

Source


<?php
function _draft_or_post_title$post_id ) {
    
$title get_the_title($post_id);
    if ( empty(
$title) )
        
$title __('(no title)');
    return 
$title;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics