wpseek.com
WordPress开发者和主题制作者的搜索引擎



block_core_breadcrumbs_get_post_title › WordPress Function

Since7.0.0
已弃用n/a
› block_core_breadcrumbs_get_post_title ( $post_id_or_object )
参数:
  • (int|WP_Post) $post_id_or_object The post ID or post object.
    Required: Yes
返回:
  • (string) The post title or fallback text.
定义在:
文档:

Gets a post title with fallback for empty titles.



源码

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