wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



block_core_breadcrumbs_get_post_title › WordPress Function

Depuis7.0.0
Dépréciéen/a
› block_core_breadcrumbs_get_post_title ( $post_id_or_object )
Paramètres:
  • (int|WP_Post) $post_id_or_object The post ID or post object.
    Requis: Oui
Retourne:
  • (string) The post title or fallback text.
Défini(e) dans:
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;
}