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

wordpress函数the_modified_time()用法示例

the_modified_time( string $d = '' )

Display the time at which the post was last modified.


描述


参数

$d

(string)
(Optional)
Either 'G', 'U', or php date format defaults to the value specified in the time_format option.

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

Default value: ''


源代码

File: wp-includes/general-template.php

function the_modified_time($d = '') {
	/**
	 * Filters the localized time a post was last modified, for display.
	 *
	 * @since 2.0.0
	 *
	 * @param string $get_the_modified_time The formatted time.
	 * @param string $d                     The time format. Accepts 'G', 'U',
	 *                                      or php date format. Defaults to value
	 *                                      specified in 'time_format' option.
	 */
	echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d );
}

更新日志

Version 描述
2.0.0 Introduced.

相关函数

Uses

  • wp-includes/general-template.php:
    get_the_modified_time()
  • wp-includes/general-template.php:
    the_modified_time
  • wp-includes/plugin.php:
    apply_filters()

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Default Usage

    Displays the time (date) the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Settings > General.

    
    <p>Last modified: <?php the_modified_time(); ?></p>
    

    Output is “Last modified: December 2, 2006”

  2. Time in the 12-hour format (am/pm)
    If a post was modified at 10:36pm, this example displays the time the post was last modified using the 12-hour format parameter string ‘g:i a’.

    
    <p>Time last modified: <?php the_modified_time('g:i a'); ?></p>
    

    Output is “Time last modified: 10:36 pm”

    Time in the 24-hour format

    If a post was modified at 10:36pm, this example displays the time the post was last modified using the 24-hour format parameter string ‘G:i’.

    
    <p>Time last modified: <?php the_modified_time('G:i'); ?></p>
    

    Output is “Time last modified: 22:36”

    Date as Month Day, Year

    Displays the last modified time and date in the date format ‘F j, Y’ (ex: December 2, 2006), which could be used to replace the tag the_modified_date().

    
    <div>Last modified: <?php the_modified_time('F j, Y'); ?></div>
    

    Output is “Last modified: December 2, 2006”.

    Date as Month Day, Year

    Displays the last modified time and date in the date format ‘F j, Y’ (ex: December 2, 2006), which could be used to replace the tag the_modified_date().

    
    <div>Last modified: <?php the_modified_time('F j, Y'); ?></div>
    

    Output is “Last modified: December 2, 2006”.

    Date and Time

    Displays the date and time.

    
    <p>Modified: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('g:i a'); ?></p>
    

    Output is “Modified: December 2, 2006 at 10:36 pm”.

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

热门推荐

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

反馈