Skip to content

Commit 92a1c32

Browse files
committed
Remove unecessary logic to get ancestor parent node
1 parent 16b3983 commit 92a1c32

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

includes/embeds/class-amp-base-embed-handler.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ static function ( DOMNode $child ) {
137137
*/
138138
protected function unwrap_p_element( DOMElement $node ) {
139139
$parent_node = $node->parentNode;
140-
while ( $parent_node && ! ( $parent_node instanceof DOMElement ) ) {
141-
$parent_node = $parent_node->parentNode;
142-
}
143140

144141
if ( $parent_node instanceof DOMElement && 'p' === $parent_node->tagName && false === $parent_node->hasAttributes() ) {
145142
$child_element_count = count( $this->get_child_elements( $parent_node ) );

0 commit comments

Comments
 (0)