^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助,如果有代码出错,请联系站长解决
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数_draft_or_post_title()用法示例

_draft_or_post_title( int|WP_Post $post )

Get the post title.


描述

The post title is fetched and if it is blank then a default string is returned.

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包


参数

$post

(int|WP_Post)
(Optional)
Post ID or WP_Post object. Default is global $post.


返回值

(string) The post title if set.


源代码

File: wp-admin/includes/template.php

function _draft_or_post_title( $post = 0 ) {
	$title = get_the_title( $post );
	if ( empty( $title ) )
		$title = __( '(no title)' );
	return esc_html( $title );
}

更新日志

Version 描述
2.7.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/formatting.php:
    esc_html()
  • wp-includes/post-template.php:
    get_the_title()

Used By

  • wp-admin/includes/class-wp-posts-list-table.php:
    WP_Posts_List_Table::handle_row_actions()
  • wp-admin/includes/class-wp-posts-list-table.php:
    WP_Posts_List_Table::column_cb()
  • wp-admin/includes/class-wp-posts-list-table.php:
    WP_Posts_List_Table::column_title()
  • wp-admin/includes/class-wp-media-list-table.php:
    WP_Media_List_Table::handle_row_actions()
  • wp-admin/includes/class-wp-media-list-table.php:
    WP_Media_List_Table::column_parent()
  • wp-admin/includes/class-wp-media-list-table.php:
    WP_Media_List_Table::column_cb()
  • wp-admin/includes/class-wp-media-list-table.php:
    WP_Media_List_Table::column_title()
  • wp-admin/includes/dashboard.php:
    wp_dashboard_recent_posts()
  • wp-admin/includes/dashboard.php:
    wp_dashboard_recent_drafts()
  • wp-admin/includes/dashboard.php:
    _wp_dashboard_recent_comments_row()
  • Show 5 more used by
    Hide more used by


让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈