Skip to content

Commit

Permalink
fix: harden post type check to prevent notices
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiulodro committed Sep 2, 2020
1 parent c86e555 commit 60879a9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions includes/class-newspack-sponsors-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public static function disable_yoast_primary_category_picker( $taxonomies, $post
* Is editing a sponsor?
*/
public static function is_editing_sponsor() {
$post_type = get_post()->post_type;
return Core::NEWSPACK_SPONSORS_CPT === $post_type;
return Core::NEWSPACK_SPONSORS_CPT === get_post_type();
}

/**
Expand Down

0 comments on commit 60879a9

Please sign in to comment.