From 8b1f1550773c3dc03f099d8494820236b47b7ae7 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 20 Jul 2023 10:55:33 +0400 Subject: [PATCH] Footnotes: Use static closures when not using '' --- packages/block-library/src/footnotes/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/footnotes/index.php b/packages/block-library/src/footnotes/index.php index d3bee13672594..d28161d6acdae 100644 --- a/packages/block-library/src/footnotes/index.php +++ b/packages/block-library/src/footnotes/index.php @@ -86,7 +86,7 @@ function register_block_core_footnotes() { * * @param int $revision_id The revision ID. */ - function( $revision_id ) { + static function( $revision_id ) { $post_id = wp_is_post_revision( $revision_id ); if ( $post_id ) { @@ -107,7 +107,7 @@ function( $revision_id ) { * * @param int $revision_id The revision ID. */ - function( $revision_id ) { + static function( $revision_id ) { global $_gutenberg_revision_id; $_gutenberg_revision_id = $revision_id; } @@ -129,7 +129,7 @@ function( $revision_id ) { * * @param WP_Post $post The post object. */ - function( $post ) { + static function( $post ) { global $_gutenberg_revision_id; if ( $_gutenberg_revision_id ) { @@ -158,7 +158,7 @@ function( $post ) { * @param int $post_id The post ID. * @param int $revision_id The revision ID. */ - function( $post_id, $revision_id ) { + static function( $post_id, $revision_id ) { $footnotes = get_post_meta( $revision_id, 'footnotes', true ); if ( $footnotes ) { @@ -180,7 +180,7 @@ function( $post_id, $revision_id ) { * * @return array The revision fields. */ - function( $fields ) { + static function( $fields ) { $fields['footnotes'] = __( 'Footnotes' ); return $fields; } @@ -198,7 +198,7 @@ function( $fields ) { * * @return string The field value. */ - function( $revision_field, $field, $revision ) { + static function( $revision_field, $field, $revision ) { return get_metadata( 'post', $revision->ID, $field, true ); }, 10,