Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footnotes: Use static closures when not using '$this' #52781

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading