We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b90ed7f commit 9219d64Copy full SHA for 9219d64
includes/embeds/class-amp-facebook-embed-handler.php
@@ -112,8 +112,8 @@ public function render( $args ) {
112
* @param Document $dom DOM.
113
*/
114
public function sanitize_raw_embeds( Document $dom ) {
115
- $embed_nodes = $dom->getElementsByTagName( $this->amp_tag );
116
-
+ // If there were any previous embeds in the DOM that were wrapped by `wpautop()`, unwrap them.
+ $embed_nodes = $dom->xpath->query( "//p/{$this->amp_tag}" );
117
if ( $embed_nodes->length ) {
118
foreach ( $embed_nodes as $embed_node ) {
119
$this->unwrap_p_element( $embed_node );
0 commit comments