Skip to content

Commit 0cad216

Browse files
committed
Docs: Clarify the purpose of post date/time functions.
This changeset clarifies the purpose of these functions and make the documentation more accurate and flexible. Instead of referring to the "date the post was written," the functions and filter descriptions now refer to the "date of the post." This change accommodates scenarios where the displayed date might not strictly correspond to the writing date (e.g. scheduled posts, backdated posts, or content where the "date" represents something other than creation). Props casiepa, audrasjb, SergeyBiryukov, Rarst, helen, azouamauriac, pbearne. Fixes #51289. git-svn-id: https://develop.svn.wordpress.org/trunk@59691 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5a8799d commit 0cad216

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/wp-includes/general-template.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ function the_date_xml() {
25172517
}
25182518

25192519
/**
2520-
* Displays or retrieves the date the current post was written (once per date)
2520+
* Displays or retrieves the date of the post (once per date).
25212521
*
25222522
* Will only output the date if the current post's date is different from the
25232523
* previous one output.
@@ -2550,7 +2550,7 @@ function the_date( $format = '', $before = '', $after = '', $display = true ) {
25502550
}
25512551

25522552
/**
2553-
* Filters the date a post was published for display.
2553+
* Filters the date of the post, for display.
25542554
*
25552555
* @since 0.71
25562556
*
@@ -2569,7 +2569,7 @@ function the_date( $format = '', $before = '', $after = '', $display = true ) {
25692569
}
25702570

25712571
/**
2572-
* Retrieves the date on which the post was written.
2572+
* Retrieves the date of the post.
25732573
*
25742574
* Unlike the_date() this function will always return the date.
25752575
* Modify output with the {@see 'get_the_date'} filter.
@@ -2592,7 +2592,7 @@ function get_the_date( $format = '', $post = null ) {
25922592
$the_date = get_post_time( $_format, false, $post, true );
25932593

25942594
/**
2595-
* Filters the date a post was published.
2595+
* Filters the date of the post.
25962596
*
25972597
* @since 3.0.0
25982598
*
@@ -2618,7 +2618,7 @@ function the_modified_date( $format = '', $before = '', $after = '', $display =
26182618
$the_modified_date = $before . get_the_modified_date( $format ) . $after;
26192619

26202620
/**
2621-
* Filters the date a post was last modified for display.
2621+
* Filters the date a post was last modified, for display.
26222622
*
26232623
* @since 2.1.0
26242624
*
@@ -2672,7 +2672,7 @@ function get_the_modified_date( $format = '', $post = null ) {
26722672
}
26732673

26742674
/**
2675-
* Displays the time at which the post was written.
2675+
* Displays the date of the post.
26762676
*
26772677
* @since 0.71
26782678
*
@@ -2682,7 +2682,7 @@ function get_the_modified_date( $format = '', $post = null ) {
26822682
*/
26832683
function the_time( $format = '' ) {
26842684
/**
2685-
* Filters the time a post was written for display.
2685+
* Filters the date of the post, for display.
26862686
*
26872687
* @since 0.71
26882688
*
@@ -2694,7 +2694,7 @@ function the_time( $format = '' ) {
26942694
}
26952695

26962696
/**
2697-
* Retrieves the time at which the post was written.
2697+
* Retrieves the date of the post.
26982698
*
26992699
* @since 1.5.0
27002700
*
@@ -2717,7 +2717,7 @@ function get_the_time( $format = '', $post = null ) {
27172717
$the_time = get_post_time( $_format, false, $post, true );
27182718

27192719
/**
2720-
* Filters the time a post was written.
2720+
* Filters the date of the post.
27212721
*
27222722
* @since 1.5.0
27232723
*
@@ -2730,7 +2730,7 @@ function get_the_time( $format = '', $post = null ) {
27302730
}
27312731

27322732
/**
2733-
* Retrieves the time at which the post was written.
2733+
* Retrieves the localized date of the post.
27342734
*
27352735
* @since 2.0.0
27362736
*
@@ -2774,12 +2774,12 @@ function get_post_time( $format = 'U', $gmt = false, $post = null, $translate =
27742774
}
27752775

27762776
/**
2777-
* Filters the localized time a post was written.
2777+
* Filters the localized date of the post.
27782778
*
27792779
* @since 2.6.0
27802780
*
27812781
* @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
2782-
* @param string $format Format to use for retrieving the time the post was written.
2782+
* @param string $format Format to use for retrieving the date of the post.
27832783
* Accepts 'G', 'U', or PHP date format.
27842784
* @param bool $gmt Whether to retrieve the GMT time.
27852785
*/
@@ -2976,7 +2976,7 @@ function get_post_modified_time( $format = 'U', $gmt = false, $post = null, $tra
29762976
}
29772977

29782978
/**
2979-
* Displays the weekday on which the post was written.
2979+
* Displays the weekday for the post.
29802980
*
29812981
* @since 0.71
29822982
*
@@ -2994,7 +2994,7 @@ function the_weekday() {
29942994
$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );
29952995

29962996
/**
2997-
* Filters the weekday on which the post was written, for display.
2997+
* Filters the weekday of the post, for display.
29982998
*
29992999
* @since 0.71
30003000
*
@@ -3004,7 +3004,7 @@ function the_weekday() {
30043004
}
30053005

30063006
/**
3007-
* Displays the weekday on which the post was written.
3007+
* Displays the localized weekday date for the post
30083008
*
30093009
* Will only output the weekday if the current post's weekday is different from
30103010
* the previous one output.
@@ -3037,7 +3037,7 @@ function the_weekday_date( $before = '', $after = '' ) {
30373037
}
30383038

30393039
/**
3040-
* Filters the localized date on which the post was written, for display.
3040+
* Filters the localized weekday date of the post, for display.
30413041
*
30423042
* @since 0.71
30433043
*
@@ -4351,7 +4351,7 @@ function get_search_query( $escaped = true ) {
43514351
*/
43524352
function the_search_query() {
43534353
/**
4354-
* Filters the contents of the search query variable for display.
4354+
* Filters the contents of the search query variable, for display.
43554355
*
43564356
* @since 2.3.0
43574357
*
@@ -4984,7 +4984,7 @@ function wp_generator() {
49844984
*/
49854985
function the_generator( $type ) {
49864986
/**
4987-
* Filters the output of the XHTML generator tag for display.
4987+
* Filters the output of the XHTML generator tag, for display.
49884988
*
49894989
* @since 2.5.0
49904990
*

0 commit comments

Comments
 (0)