Make WordPress Core


Ignore:
Timestamp:
12/09/2019 11:48:00 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Twenty Twenty: Pass $post_meta and $location values to twentytwenty_start_of_post_meta_list and twentytwenty_end_of_post_meta_list actions to provide better context.

Props msaari, SergeyBiryukov.
Fixes #48906.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php

    r46827 r46832  
    264264        *  @type string 'post-date'
    265265        *  @type string 'comments'
    266         *  @type string  'sticky'
     266        *  @type string 'sticky'
    267267        * }
    268268        */
    269         $post_meta                 = apply_filters(
     269        $post_meta = apply_filters(
    270270            'twentytwenty_post_meta_location_single_top',
    271271            array(
     
    276276            )
    277277        );
     278
    278279        $post_meta_wrapper_classes = ' post-meta-single post-meta-single-top';
    279280
     
    291292        * }
    292293        */
    293         $post_meta                 = apply_filters(
     294        $post_meta = apply_filters(
    294295            'twentytwenty_post_meta_location_single_bottom',
    295296            array(
     
    297298            )
    298299        );
     300
    299301        $post_meta_wrapper_classes = ' post-meta-single post-meta-single-bottom';
    300302
     
    327329                 *
    328330                 * @since Twenty Twenty 1.0
     331                 * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
    329332                 *
    330                  * @param int   $post_ID Post ID.
     333                 * @param int    $post_id   Post ID.
     334                 * @param array  $post_meta An array of post meta information.
     335                 * @param string $location  The location where the meta is shown.
     336                 *                          Accepts 'single-top' or 'single-bottom'.
    331337                 */
    332                 do_action( 'twentytwenty_start_of_post_meta_list', $post_id );
     338                do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location );
    333339
    334340                // Author.
     
    450456                 *
    451457                 * @since Twenty Twenty 1.0
     458                 * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
    452459                 *
    453                  * @param int   $post_ID Post ID.
     460                 * @param int    $post_id   Post ID.
     461                 * @param array  $post_meta An array of post meta information.
     462                 * @param string $location  The location where the meta is shown.
     463                 *                          Accepts 'single-top' or 'single-bottom'.
    454464                 */
    455                 do_action( 'twentytwenty_end_of_post_meta_list', $post_id );
     465                do_action( 'twentytwenty_end_of_post_meta_list', $post_id, $post_meta, $location );
    456466
    457467                ?>
Note: See TracChangeset for help on using the changeset viewer.