Skip to content

Commit

Permalink
Exclude Polls from Broadcast Import
Browse files Browse the repository at this point in the history
  • Loading branch information
n7studios committed Oct 21, 2024
1 parent 948e894 commit 6ef10c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion includes/class-convertkit-broadcasts-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,16 @@ private function parse_broadcast_content( $broadcast_content ) {
}

// Remove ck-hide-in-public-posts and their contents.
// This includesthe unsubscribe section.
// This includes the unsubscribe section.
foreach ( $xpath->query( '//div[contains(@class, "ck-hide-in-public-posts")]' ) as $node ) {
$node->parentNode->removeChild( $node ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
}

// Remove ck-poll, as interacting with these results in an error.
foreach ( $xpath->query( '//table[contains(@class, "ck-poll")]' ) as $node ) {
$node->parentNode->removeChild( $node ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
}

// Save HTML to a string.
$content = $html->saveHTML();

Expand Down

0 comments on commit 6ef10c6

Please sign in to comment.