Astra_Ext_Sticky_Header_Markup::add_options_markup( array $meta )

Sticky Header Meta Field markup


Description

Loads appropriate template file based on the style option selected in options panel.


Parameters

$meta

(array) (Required) Page Meta.


Source

File: addons/sticky-header/classes/class-astra-ext-sticky-header-markup.php

		public function add_options_markup( $meta ) {

			/**
			 * Get options
			 */
			$sticky_main       = ( isset( $meta['header-main-stick-meta']['default'] ) ) ? $meta['header-main-stick-meta']['default'] : 'on';
			$stick_header_meta = ( isset( $meta['stick-header-meta']['default'] ) ) ? $meta['stick-header-meta']['default'] : 'default';
			$show_meta_field   = ! astra_check_is_bb_themer_layout();

			if ( Astra_Ext_Extension::is_active( 'header-sections' ) ) {
				$sticky_top   = ( isset( $meta['header-above-stick-meta']['default'] ) ) ? $meta['header-above-stick-meta']['default'] : 'on';
				$sticky_below = ( isset( $meta['header-below-stick-meta']['default'] ) ) ? $meta['header-below-stick-meta']['default'] : 'on';
			}
			?>

			<?php if ( $show_meta_field ) { ?>
				<div class="stick-header-wrapper">
					<p class="post-attributes-label-wrapper">
						<strong> <?php esc_html_e( 'Sticky Header', 'astra-addon' ); ?> </strong><br/>
					</p>
						<select name="stick-header-meta" id="stick-header-meta">
							<option value="default" <?php selected( $stick_header_meta, 'default' ); ?>> <?php esc_html_e( 'Customizer Setting', 'astra-addon' ); ?> </option>
							<option value="enabled" <?php selected( $stick_header_meta, 'enabled' ); ?>> <?php esc_html_e( 'Enabled', 'astra-addon' ); ?> </option>
							<option value="disabled" <?php selected( $stick_header_meta, 'disabled' ); ?>> <?php esc_html_e( 'Disabled', 'astra-addon' ); ?> </option>
						</select>

					<div id="stick-header-meta-options">
						<?php
						if ( Astra_Ext_Extension::is_active( 'header-sections' ) ) {
							// Above Header Layout.
							$above_header_layout = astra_get_option( 'above-header-layout' );
							if ( 'disabled' != $above_header_layout ) {
								?>
									<div class="sticky-above-header-meta-wrapper" >
									<p class="post-attributes-label-wrapper">
										<input type="checkbox" id="header-above-stick-meta" name="header-above-stick-meta" value="on" <?php checked( $sticky_top, 'on' ); ?> />
										<label for="header-above-stick-meta"><?php esc_html_e( 'Stick Above Header', 'astra-addon' ); ?></label>
									</p>
									</div>
								<?php
							}
						}
						// Main Header Layout.
						$header_layouts = astra_get_option( 'header-layouts' );
						if ( 'header-main-layout-5' != $header_layouts ) {
							?>

						<div class="stick-main-header-meta-wrapper">
							<p class="post-attributes-label-wrapper">
							<input type="checkbox" id="header-main-stick-meta" name="header-main-stick-meta" value="on" <?php checked( $sticky_main, 'on' ); ?> />
							<label for="header-main-stick-meta"><?php esc_html_e( 'Stick Primary Header', 'astra-addon' ); ?></label>
							</p>
						</div>
							<?php
						}
						if ( Astra_Ext_Extension::is_active( 'header-sections' ) ) {
							// Below Header Layout.
							$below_header_layout = astra_get_option( 'below-header-layout' );
							if ( 'disabled' != $below_header_layout ) {
								?>
									<div class="sticky-below-header-meta-wrapper" >
									<p class="post-attributes-label-wrapper">
										<input type="checkbox" id="header-below-stick-meta" name="header-below-stick-meta" value="on" <?php checked( $sticky_below, 'on' ); ?> />
										<label for="header-below-stick-meta"><?php esc_html_e( 'Stick Below Header', 'astra-addon' ); ?></label>
									</p>
									</div>
								<?php
							}
						}
						?>

					</div>
				</div>
			<?php } ?>
			<?php
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

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