From 6c49066de7232bcae92d9d75de51ec90cb18e98e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 9 Dec 2019 11:49:02 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@46832 git-svn-id: http://core.svn.wordpress.org/trunk@46632 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentytwenty/inc/template-tags.php | 24 +++++++++++++------ wp-includes/version.php | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/wp-content/themes/twentytwenty/inc/template-tags.php b/wp-content/themes/twentytwenty/inc/template-tags.php index 625d62edbf..afa7ab10c4 100644 --- a/wp-content/themes/twentytwenty/inc/template-tags.php +++ b/wp-content/themes/twentytwenty/inc/template-tags.php @@ -263,10 +263,10 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) * @type string 'author' * @type string 'post-date' * @type string 'comments' - * @type string 'sticky' + * @type string 'sticky' * } */ - $post_meta = apply_filters( + $post_meta = apply_filters( 'twentytwenty_post_meta_location_single_top', array( 'author', @@ -275,6 +275,7 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) 'sticky', ) ); + $post_meta_wrapper_classes = ' post-meta-single post-meta-single-top'; } elseif ( 'single-bottom' === $location ) { @@ -290,12 +291,13 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) * @type string 'tags' * } */ - $post_meta = apply_filters( + $post_meta = apply_filters( 'twentytwenty_post_meta_location_single_bottom', array( 'tags', ) ); + $post_meta_wrapper_classes = ' post-meta-single post-meta-single-bottom'; } @@ -326,10 +328,14 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) * Allow output of additional post meta info to be added by child themes and plugins. * * @since Twenty Twenty 1.0 + * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters. * - * @param int $post_ID Post ID. + * @param int $post_id Post ID. + * @param array $post_meta An array of post meta information. + * @param string $location The location where the meta is shown. + * Accepts 'single-top' or 'single-bottom'. */ - do_action( 'twentytwenty_start_of_post_meta_list', $post_id ); + do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location ); // Author. if ( in_array( 'author', $post_meta, true ) ) { @@ -449,10 +455,14 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) * Allow output of additional post meta info to be added by child themes and plugins. * * @since Twenty Twenty 1.0 + * @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters. * - * @param int $post_ID Post ID. + * @param int $post_id Post ID. + * @param array $post_meta An array of post meta information. + * @param string $location The location where the meta is shown. + * Accepts 'single-top' or 'single-bottom'. */ - do_action( 'twentytwenty_end_of_post_meta_list', $post_id ); + do_action( 'twentytwenty_end_of_post_meta_list', $post_id, $post_meta, $location ); ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index 0a285c9b42..d4ab9ea34c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46831'; +$wp_version = '5.4-alpha-46832'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.