Skip to content

Commit 8410d5e

Browse files
authored
fix: ensure that sponsors can't be applied to other sponsors (#55)
1 parent 2817220 commit 8410d5e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/newspack-sponsors-theme-helpers.php

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ function get_sponsors_for_post( $post_id = null, $scope = null, $logo_options =
103103
return false;
104104
}
105105

106+
// Sponsors can't sponsor other sponsors.
107+
if ( Core::NEWSPACK_SPONSORS_CPT === $post->post_type ) {
108+
return false;
109+
}
110+
106111
$sponsors = [];
107112
$direct_sponsors = get_the_terms( $post_id, Core::NEWSPACK_SPONSORS_TAX );
108113
$categories = get_the_category( $post_id );

0 commit comments

Comments
 (0)