| 1 |
<?php |
| 2 |
|
| 3 |
if( ! function_exists( 'ef_draft_or_post_title' ) ) : |
| 4 |
/** |
| 5 |
* Copy of core's _draft_or_post_title without the filters |
| 6 |
* |
| 7 |
* The post title is fetched and if it is blank then a default string is |
| 8 |
* returned. |
| 9 |
* @param int $post_id The post id. If not supplied the global $post is used. |
| 10 |
* @return string The post title if set |
| 11 |
*/ |
| 12 |
function ef_draft_or_post_title( $post_id = 0 ) { |
| 13 |
$post = get_post( $post_id ); |
| 14 |
return ! empty( $post->post_title ) ? $post->post_title : __( '(no title)', 'edit-flow' ); |
| 15 |
} |
| 16 |
endif; |