Astra_AMP::menu_toggle_button( array $attr, string $context, array $args )
Add AMP attribites to the toggle button to add .ast-submenu-expanded
class to parent li.
Description
Parameters
- $attr
-
(array) (Optional) Extra attributes to merge with defaults.
- $context
-
(string) (Optional) The context, to build filter name.
- $args
-
(array) (Optional) Custom data to pass to filter.
Return
(Array) updated HTML attributes.
Source
File: inc/compatibility/class-astra-amp.php
public function menu_toggle_button( $attr, $context, $args ) { $attr['[class]'] = '( astraNavMenuItemExpanded' . $args->ID . ' ? \' ast-menu-toggle dropdown-open\' : \'ast-menu-toggle\')'; $attr['on'] = 'tap:AMP.setState( { astraNavMenuItemExpanded' . $args->ID . ': ! astraNavMenuItemExpanded' . $args->ID . ' } )'; return $attr; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.7.0 | Introduced. |