Created
September 12, 2018 17:24
-
-
Save wasipo/45a92a5a29b48f8cb208c7d8557c460d to your computer and use it in GitHub Desktop.
DOMMMM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$image = getFirstImage(get_the_content()); | |
if(!empty($image)) { | |
$doc = new DOMDocument(); | |
@$doc->loadHTML($image); | |
$finder = new DomXPath($doc); | |
$ele = $finder->query("//*[contains(@class, 'alignnone')]")->item(0)->removeAttribute; // <- こいつがエラーするんだ | |
var_dump($ele); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment