We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9560368 commit 141982eCopy full SHA for 141982e
src/wp-includes/comment.php
@@ -240,9 +240,12 @@ function get_comment( $comment = null, $output = OBJECT ) {
240
*
241
* @since 2.3.0
242
243
- * @param WP_Comment $_comment Comment data.
+ * @param WP_Comment|null $_comment Comment data.
244
*/
245
$_comment = apply_filters( 'get_comment', $_comment );
246
+ if ( ! ( $_comment instanceof WP_Comment ) ) {
247
+ return null;
248
+ }
249
250
if ( OBJECT === $output ) {
251
return $_comment;
0 commit comments