From dc27839684f65bb6d7ed92db253b05ddbb0d07a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Santos?= Date: Thu, 21 Mar 2024 18:28:48 +0000 Subject: [PATCH] Check if $post is instance of \WP_Post --- includes/UI/MetaBox.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/UI/MetaBox.php b/includes/UI/MetaBox.php index b341503..cad50c1 100644 --- a/includes/UI/MetaBox.php +++ b/includes/UI/MetaBox.php @@ -12,6 +12,11 @@ public function setup() { } public function add_meta_boxes( $post_type, $post ) { + + if ( ! $post instanceof \WP_Post ) { + return; + } + // If we have any relationships to show on this page, their data will be injected here by filters $relationships = apply_filters( 'tenup_content_connect_post_relationship_data', array(), $post );