Skip to content

Commit

Permalink
bugfix: fail if post id is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
matt committed Dec 18, 2023
1 parent bbf9311 commit d9e4ab6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions accessibility-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,16 @@ function edac_before_page_render() {

// Check the page if it hasn't already been checked.
global $post;
$checked = get_post_meta( $post->ID, '_edac_post_checked', true );

$post_id = is_object( $post ) ? $post->ID : null;

if ( null === $post_id ) {
return;
}

$checked = get_post_meta( $post_id, '_edac_post_checked', true );
if ( false === boolval( $checked ) ) {
edac_validate( $post->ID, $post, $action = 'load' );
edac_validate( $post_id, $post, $action = 'load' );
}
}
}
Expand Down

0 comments on commit d9e4ab6

Please sign in to comment.