Changeset 48631
- Timestamp:
- 07/27/2020 02:16:46 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r48620 r48631 6621 6621 */ 6622 6622 function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) { 6623 $date = _get_last_post_time( $timezone, 'date', $post_type ); 6624 6623 6625 /** 6624 6626 * Filters the most recent time that a post on the site was published. 6625 6627 * 6626 6628 * @since 2.3.0 6627 * 6628 * @param string|false $date Date the last post was published. False on failure. 6629 * @param string $timezone Location to use for getting the post published date. 6630 * See get_lastpostdate() for accepted `$timezone` values. 6629 * @since 5.5.0 Added the `$post_type` parameter. 6630 * 6631 * @param string|false $date Date the last post was published. False on failure. 6632 * @param string $timezone Location to use for getting the post published date. 6633 * See get_lastpostdate() for accepted `$timezone` values. 6634 * @param string $post_type The post type to check. 6631 6635 */ 6632 return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date', $post_type ), $timezone );6636 return apply_filters( 'get_lastpostdate', $date, $timezone, $post_type ); 6633 6637 } 6634 6638 … … 6662 6666 */ 6663 6667 $lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type ); 6668 6664 6669 if ( false !== $lastpostmodified ) { 6665 6670 return $lastpostmodified; … … 6667 6672 6668 6673 $lastpostmodified = _get_last_post_time( $timezone, 'modified', $post_type ); 6669 6670 $lastpostdate = get_lastpostdate( $timezone ); 6674 $lastpostdate = get_lastpostdate( $timezone, $post_type ); 6675 6671 6676 if ( $lastpostdate > $lastpostmodified ) { 6672 6677 $lastpostmodified = $lastpostdate; … … 6677 6682 * 6678 6683 * @since 2.3.0 6684 * @since 5.5.0 Added the `$post_type` parameter. 6679 6685 * 6680 6686 * @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format. … … 6682 6688 * @param string $timezone Location to use for getting the post modified date. 6683 6689 * See get_lastpostdate() for accepted `$timezone` values. 6690 * @param string $post_type The post type to check. 6684 6691 */ 6685 return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );6692 return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone, $post_type ); 6686 6693 } 6687 6694
Note: See TracChangeset
for help on using the changeset viewer.