Skip to content

Commit

Permalink
Footnotes: Use static closures when not using '' (#52781)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jul 20, 2023
1 parent 4bfc190 commit 25489da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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;
}
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand All @@ -180,7 +180,7 @@ function( $post_id, $revision_id ) {
*
* @return array The revision fields.
*/
function( $fields ) {
static function( $fields ) {
$fields['footnotes'] = __( 'Footnotes' );
return $fields;
}
Expand All @@ -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,
Expand Down

1 comment on commit 25489da

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 25489da.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5609040298
📝 Reported issues:

Please sign in to comment.