Skip to content

Commit

Permalink
fix: check for valid ID before post type check (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe authored Aug 13, 2024
1 parent 656dc0c commit 96e21bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/class-newspack-newsletters.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ public static function api_set_post_meta( $request ) {
* @param int $id Post ID.
*/
public static function validate_newsletter_id( $id ) {
if ( ! $id ) {
return false;
}
return self::NEWSPACK_NEWSLETTERS_CPT === get_post_type( $id );
}

Expand Down

0 comments on commit 96e21bc

Please sign in to comment.