Astra_Builder_Helper::render_mobile_popup_markup()

Adds support to render Mobile Popup Markup.


Description


Source

File: inc/core/builder/class-astra-builder-helper.php

	public static function render_mobile_popup_markup() {
		if ( ! self::is_component_loaded( 'mobile-trigger', 'header' ) && ! is_customize_preview() ) {
			return;
		}

		$off_canvas_slide   = astra_get_option( 'off-canvas-slide' );
		$mobile_header_type = astra_get_option( 'mobile-header-type' );
		$content_alignment  = astra_get_option( 'header-offcanvas-content-alignment' );

		$side_class = 'content-align-' . $content_alignment . ' ';

		if ( $mobile_header_type ) {

			if ( 'off-canvas' === $mobile_header_type ) {

				if ( $off_canvas_slide ) {

					if ( 'left' === $off_canvas_slide ) {

						$side_class .= 'ast-mobile-popup-left';
					} else {

						$side_class .= 'ast-mobile-popup-right';
					}
				}
			} else {
				$side_class .= 'ast-mobile-popup-full-width';
			}
		}
		?>
		<div id="ast-mobile-popup-wrapper">
			<div id="ast-mobile-popup" class="ast-mobile-popup-drawer <?php echo esc_attr( $side_class ); ?>">
			<div class="ast-mobile-popup-overlay"></div>
			<div class="ast-mobile-popup-inner">
					<div class="ast-mobile-popup-header">
						<button id="menu-toggle-close" class="menu-toggle-close" aria-label="Close menu">
							<span class="ast-svg-iconset">
								<?php echo Astra_Builder_UI_Controller::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
							</span>
						</button>
					</div>
					<div class="ast-mobile-popup-content">
						<?php
							/**
							 * Astra Off-Canvas
							 */
							do_action( 'astra_render_mobile_popup', 'popup', 'content' );
						?>
					</div>
					<div class="ast-desktop-popup-content">
						<?php
							/**
							 * Astra Off-Canvas
							 */
							do_action( 'astra_render_desktop_popup', 'popup', 'content' );
						?>
					</div>
				</div>
		</div>
		</div>

		<?php
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.