block_core_breadcrumbs_get_post_title()
Gets a post title with fallback for empty titles.
Хуков нет.
Возвращает
string. The post title or fallback text.
Использование
block_core_breadcrumbs_get_post_title( $post_id_or_object );
- $post_id_or_object(int|WP_Post) (обязательный)
- The post ID or post object.
Список изменений
| С версии 7.0.0 | Введена. |
Код block_core_breadcrumbs_get_post_title() block core breadcrumbs get post title WP 7.1.3
function block_core_breadcrumbs_get_post_title( $post_id_or_object ) {
$title = get_the_title( $post_id_or_object );
if ( strlen( $title ) === 0 ) {
$title = __( '(no title)' );
}
return $title;
}