Skip to content

Commit

Permalink
Footnotes: fix PHP unit failures for revision handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 24, 2023
1 parent cdd4f8b commit 41d87c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ static function( $post ) {

if ( $_gutenberg_revision_id ) {
$revision = get_post( $_gutenberg_revision_id );
$post_id = $revision->post_parent;

// Just making sure we're updating the right revision.
if ( $post->ID === $post_id ) {
$footnotes = get_post_meta( $post_id, 'footnotes', true );
if ( $revision->post_parent && $post->ID === $revision->post_parent ) {
$footnotes = get_post_meta( $post->ID, 'footnotes', true );

if ( $footnotes ) {
// Can't use update_post_meta() because it doesn't allow revisions.
Expand Down

0 comments on commit 41d87c0

Please sign in to comment.