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



block_core_breadcrumbs_get_post_title › WordPress Function

Since7.0.0
Deprecatedn/a
block_core_breadcrumbs_get_post_title ( $post_id_or_object )
Parameters:
  • (int|WP_Post) $post_id_or_object The post ID or post object.
    Required: Yes
Returns:
  • (string) The post title or fallback text.
Defined at:
Codex:

Gets a post title with fallback for empty titles.



Source

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;
}