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 ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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