Skip to content

Commit 0681b06

Browse files
committed
Simplify webmentions_open and add better comment
1 parent ab67e07 commit 0681b06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

includes/functions.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,8 @@ function webmentions_open( $post = null ) {
561561
// If the post type does not support Webmentions do not even check further.
562562
$open = false;
563563
} else {
564-
// If the webmentions_closed meta ID has a value then consider webmentions to be open.
565-
$open = get_post_meta( $post->ID, 'webmentions_closed', true );
566-
$open = empty( $open ) ? true : false;
564+
// If the webmentions_closed meta key exists then consider webmentions closed. Otherwise consider them open.
565+
$open = ! ( metadata_exists( 'post', $post_id, 'webmentions_closed' ) ); // Invert the result, as exists is closed and not exists is open.
567566
}
568567
}
569568

0 commit comments

Comments
 (0)