[wp-trac] [WordPress Trac] #37059: Allow post to be passed to get_the_modified_time & get_the_modified_date

WordPress Trac noreply at wordpress.org
Sun Jun 12 04:21:52 UTC 2016


#37059: Allow post to be passed to get_the_modified_time & get_the_modified_date
-------------------------------------------------+-------------------------
 Reporter:  peterwilsoncc                        |       Owner:
     Type:  enhancement                          |  peterwilsoncc
 Priority:  normal                               |      Status:  reviewing
Component:  Posts, Post Types                    |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  good-first-bug has-patch has-unit-   |     Version:
  tests needs-refresh                            |  Resolution:
                                                 |     Focuses:
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * keywords:  good-first-bug has-patch has-unit-tests => good-first-bug has-
     patch has-unit-tests needs-refresh


Comment:

 Thanks for the patches @Soean and @lukecavanagh.

 Just a few notes to get the patch commit ready. I'm basing them off the
 latest patch, [attachment:37059.3.diff]

 This looks like a lot but it's all really minor (and I'm verbose).

 In the source code:

 * In the docs:
   * add a second `@since` tag noting the new argument (similar to the
 `language_attributes` function in the same file).
   * align the `@param` variables and descriptions.
 * Add the `get_post` & check for a valid post similar to the check in
 `get_the_time`
 * The filters in the functions we're aiming to match also accept the post
 as an argument, let's match them too (noting the update in the docs).
 * There's a couple of coding standards (whitespace) fixes required in
 `get_the_modified_date`'s first call to `get_post_modified_time`

 In the tests:

 * Coding standards (whitespace) the closing brace of the first new
 function onwards are incorrectly indented.
 * Add some documentation for each function, including:
   * explanation
   * since tags
   * this ticket number
 * `...with_post_id` is clearer for people scanning the code.

 As I say, all quite minor.

 Pete

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37059#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list