diff --git a/includes/apple-exporter/components/class-component.php b/includes/apple-exporter/components/class-component.php index fa4b6b69..d8c9200a 100644 --- a/includes/apple-exporter/components/class-component.php +++ b/includes/apple-exporter/components/class-component.php @@ -882,39 +882,5 @@ public static function get_iframe_from_node( $node ) { return null; } - - /** - * Get iframe/embed node. - * - * @param DOMElement $node The node to examine. - * - * @return bool True if the figure is an iframe. - */ - public static function is_embed_figure( $node ) { - - // Return false if we don't have any child nodes. - if ( ! $node->hasChildNodes() ) { - return false; - } - - // Loop those child nodes. - foreach ( $node->childNodes as $child ) { - - // Return false if we don't have children, or if is an image. - if ( ! $child->hasChildNodes() || 'img' === $child->nodeName ) { - return false; - } - - foreach ( $child->childNodes as $c ) { - - // Return true if we're seeing an iframe. - if ( 'iframe' === $c->nodeName ) { - return true; - } - } - } - - return false; - } /* phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */ } diff --git a/includes/apple-exporter/components/class-image.php b/includes/apple-exporter/components/class-image.php index 0204f38d..8a81a8cd 100644 --- a/includes/apple-exporter/components/class-image.php +++ b/includes/apple-exporter/components/class-image.php @@ -40,8 +40,7 @@ public static function node_matches( $node ) { if ( self::node_has_class( $node, 'wp-block-cover' ) || 'img' === $node->nodeName || ( 'figure' === $node->nodeName - && ( Component::is_embed_figure( $node ) - || self::node_has_class( $node, 'wp-caption' ) + && ( self::node_has_class( $node, 'wp-caption' ) || $has_image_child ) )