[wp-trac] [WordPress Trac] #35262: New function: `has_title`

WordPress Trac noreply at wordpress.org
Wed Dec 30 11:20:31 UTC 2015


#35262: New function: `has_title`
-------------------------------+------------------------------
 Reporter:  sebastian.pisula   |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  template
-------------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => reporter-feedback
 * focuses:   => template


Comment:

 Can you give an example why this specific function is needed?

 Doesn't `if( get_the_title() ) { /* do something */ }` suffice?

 If it's because you want to only display an `<h1>`when there's a title,
 you can just use `the_title( '<h1>', '</h1>' );`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35262#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list