Skip to content

Commit 60879a9

Browse files
committed
fix: harden post type check to prevent notices
1 parent c86e555 commit 60879a9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

includes/class-newspack-sponsors-editor.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ public static function disable_yoast_primary_category_picker( $taxonomies, $post
9999
* Is editing a sponsor?
100100
*/
101101
public static function is_editing_sponsor() {
102-
$post_type = get_post()->post_type;
103-
return Core::NEWSPACK_SPONSORS_CPT === $post_type;
102+
return Core::NEWSPACK_SPONSORS_CPT === get_post_type();
104103
}
105104

106105
/**

0 commit comments

Comments
 (0)