Created
September 10, 2020 03:39
-
-
Save westonruter/8285137fd3d458a4a6984a30cd9576a4 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Add_Hide_Content_Class_Name_To_Main_Menu_On_Page_2906; | |
class Sanitizer extends \AMP_Base_Sanitizer { | |
function sanitize() { | |
$main_menu = $this->dom->xpath->query( '//nav[ contains( @class, "main_menu" ) ]' )->item( 0 ); | |
if ( $main_menu instanceof \DOMElement ) { | |
$main_menu->setAttribute( 'class', $main_menu->getAttribute( 'class' ) . ' hide_content' ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment