wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



block_core_breadcrumbs_get_post_title › WordPress Function

Seit7.0.0
Veraltetn/v
block_core_breadcrumbs_get_post_title ( $post_id_or_object )
Parameter:
  • (int|WP_Post) $post_id_or_object The post ID or post object.
    Erforderlich: Ja
Gibt zurück:
  • (string) The post title or fallback text.
Definiert in:
Codex:

Gets a post title with fallback for empty titles.



Quellcode

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