⚡ NEW: Changeset/ - Complete Album!

Changeset 59691


Ignore:
Timestamp:
01/22/2025 11:29:25 PM (11 months ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r59606 r59691  
    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
     
    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
     
    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.
     
    25932593
    25942594    /**
    2595      * Filters the date a post was published.
     2595     * Filters the date of the post.
    25962596     *
    25972597     * @since 3.0.0
     
    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
     
    26732673
    26742674/**
    2675  * Displays the time at which the post was written.
     2675 * Displays the date of the post.
    26762676 *
    26772677 * @since 0.71
     
    26832683function 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
     
    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
     
    27182718
    27192719    /**
    2720      * Filters the time a post was written.
     2720     * Filters the date of the post.
    27212721     *
    27222722     * @since 1.5.0
     
    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
     
    27752775
    27762776    /**
    2777      * Filters the localized time a post was written.
     2777     * Filters the localized date of the post