I haven't used DOMdocument before so the syntax etc is all a bit new to me.
I'm trying to use PHP DOMdocument and Xpath to find and element by a specific class name and then wrap it in a new tag.
Eg: I have this inside a <content:encoded> block
:
<iframe class="youtubeEmbed figureWrap" src="..."></iframe>
The class figureWrap
means it needs wrapping in <figure>
tags and youtubeEmbed
means that figure requires a specific class adding to it (op-interactive
)
I've found xpath query to detect things by class name but beyond that I'm getting a bit stuck. Can anyone help?
tag into the new wrapper element if that's feasible?
– MrLewk Feb 10 '17 at 08:02tags. I use xpath the find it and wrap in a tag, but still need to remove the parent paragraph wrapper. That's where I get stuck
– MrLewk Feb 10 '17 at 08:31