Astra_AMP::astra_amp_init()
Init Astra Amp Compatibility.
Description
This adds required actions and filters only if AMP endpoinnt is detected.
Return
(void)
Source
File: inc/compatibility/class-astra-amp.php
public function astra_amp_init() { // bail if AMP endpoint is not detected. if ( ! astra_is_amp_endpoint() ) { return; } add_filter( 'astra_nav_toggle_data_attrs', array( $this, 'add_nav_toggle_attrs' ) ); add_filter( 'astra_search_slide_toggle_data_attrs', array( $this, 'add_search_slide_toggle_attrs' ) ); add_filter( 'astra_search_field_toggle_data_attrs', array( $this, 'add_search_field_toggle_attrs' ) ); add_action( 'wp_footer', array( $this, 'render_amp_states' ) ); add_filter( 'astra_attr_ast-main-header-bar-alignment', array( $this, 'nav_menu_wrapper' ) ); add_filter( 'astra_attr_ast-menu-toggle', array( $this, 'menu_toggle_button' ), 20, 3 ); add_filter( 'astra_theme_dynamic_css', array( $this, 'dynamic_css' ) ); add_filter( 'astra_toggle_button_markup', array( $this, 'toggle_button_markup' ), 20, 2 ); add_filter( 'astra_schema_body', array( $this, 'body_id' ) ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.7.0 | Introduced. |