Astra_Meta_Boxes::markup_meta_box( object $post )
Metabox Markup
Description
Parameters
- $post
-
(object) (Required) Post object.
Return
(void)
Source
File: inc/metabox/class-astra-meta-boxes.php
public function markup_meta_box( $post ) { wp_nonce_field( basename( __FILE__ ), 'astra_settings_meta_box' ); $stored = get_post_meta( $post->ID ); if ( is_array( $stored ) ) { // Set stored and override defaults. foreach ( $stored as $key => $value ) { self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : ''; } } // Get defaults. $meta = self::get_meta_option(); /** * Get options */ $site_sidebar = ( isset( $meta['site-sidebar-layout']['default'] ) ) ? $meta['site-sidebar-layout']['default'] : 'default'; $site_content_layout = ( isset( $meta['site-content-layout']['default'] ) ) ? $meta['site-content-layout']['default'] : 'default'; $site_post_title = ( isset( $meta['site-post-title']['default'] ) ) ? $meta['site-post-title']['default'] : ''; $footer_bar = ( isset( $meta['footer-sml-layout']['default'] ) ) ? $meta['footer-sml-layout']['default'] : ''; $footer_widgets = ( isset( $meta['footer-adv-display']['default'] ) ) ? $meta['footer-adv-display']['default'] : ''; $above_header = ( isset( $meta['ast-hfb-above-header-display']['default'] ) ) ? $meta['ast-hfb-above-header-display']['default'] : 'default'; $primary_header = ( isset( $meta['ast-main-header-display']['default'] ) ) ? $meta['ast-main-header-display']['default'] : ''; $below_header = ( isset( $meta['ast-hfb-below-header-display']['default'] ) ) ? $meta['ast-hfb-below-header-display']['default'] : 'default'; $mobile_header = ( isset( $meta['ast-hfb-mobile-header-display']['default'] ) ) ? $meta['ast-hfb-mobile-header-display']['default'] : 'default'; $ast_featured_img = ( isset( $meta['ast-featured-img']['default'] ) ) ? $meta['ast-featured-img']['default'] : ''; $breadcrumbs_content = ( isset( $meta['ast-breadcrumbs-content']['default'] ) ) ? $meta['ast-breadcrumbs-content']['default'] : ''; $show_meta_field = ! self::is_bb_themer_layout(); do_action( 'astra_meta_box_markup_before', $meta ); /** * Option: Sidebar */ ?> <div class="site-sidebar-layout-meta-wrap components-base-control__field"> <p class="post-attributes-label-wrapper" > <strong> <?php esc_html_e( 'Sidebar', 'astra' ); ?> </strong> </p> <select name="site-sidebar-layout" id="site-sidebar-layout"> <option value="default" <?php selected( $site_sidebar, 'default' ); ?> > <?php esc_html_e( 'Customizer Setting', 'astra' ); ?></option> <option value="left-sidebar" <?php selected( $site_sidebar, 'left-sidebar' ); ?> > <?php esc_html_e( 'Left Sidebar', 'astra' ); ?></option> <option value="right-sidebar" <?php selected( $site_sidebar, 'right-sidebar' ); ?> > <?php esc_html_e( 'Right Sidebar', 'astra' ); ?></option> <option value="no-sidebar" <?php selected( $site_sidebar, 'no-sidebar' ); ?> > <?php esc_html_e( 'No Sidebar', 'astra' ); ?></option> </select> </div> <?php /** * Option: Sidebar */ ?> <div class="site-content-layout-meta-wrap components-base-control__field"> <p class="post-attributes-label-wrapper" > <strong> <?php esc_html_e( 'Content Layout', 'astra' ); ?> </strong> </p> <select name="site-content-layout" id="site-content-layout"> <option value="default" <?php selected( $site_content_layout, 'default' ); ?> > <?php esc_html_e( 'Customizer Setting', 'astra' ); ?></option> <option value="boxed-container" <?php selected( $site_content_layout, 'boxed-container' ); ?> > <?php esc_html_e( 'Boxed', 'astra' ); ?></option> <option value="content-boxed-container" <?php selected( $site_content_layout, 'content-boxed-container' ); ?> > <?php esc_html_e( 'Content Boxed', 'astra' ); ?></option> <option value="plain-container" <?php selected( $site_content_layout, 'plain-container' ); ?> > <?php esc_html_e( 'Full Width / Contained', 'astra' ); ?></option> <option value="page-builder" <?php selected( $site_content_layout, 'page-builder' ); ?> > <?php esc_html_e( 'Full Width / Stretched', 'astra' ); ?></option> </select> </div> <?php /** * Option: Disable Sections - Primary Header, Title, Footer Widgets, Footer Bar */ ?> <div class="disable-section-meta-wrap components-base-control__field"> <p class="post-attributes-label-wrapper"> <strong> <?php esc_html_e( 'Disable Sections', 'astra' ); ?> </strong> </p> <div class="disable-section-meta"> <?php do_action( 'astra_meta_box_markup_disable_sections_before', $meta ); ?> <?php if ( $show_meta_field && Astra_Builder_Helper::is_row_empty( 'above', 'header', 'desktop' ) ) : ?> <div class="ast-hfb-above-header-display-option-wrap"> <input type="checkbox" id="ast-hfb-above-header-display" name="ast-hfb-above-header-display" value="disabled" <?php checked( $above_header, 'disabled' ); ?> /> <label for="ast-hfb-above-header-display"><?php esc_html_e( 'Disable Above Header', 'astra' ); ?></label> <br /> </div> <?php endif; ?> <?php if ( $show_meta_field && Astra_Builder_Helper::is_row_empty( 'primary', 'header', 'desktop' ) ) : ?> <div class="ast-main-header-display-option-wrap"> <label for="ast-main-header-display"> <input type="checkbox" id="ast-main-header-display" name="ast-main-header-display" value="disabled" <?php checked( $primary_header, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Primary Header', 'astra' ); ?> </label> </div> <?php endif; ?> <?php if ( $show_meta_field && Astra_Builder_Helper::is_row_empty( 'below', 'header', 'desktop' ) ) : ?> <div class="ast-hfb-below-header-display-option-wrap"> <input type="checkbox" id="ast-hfb-below-header-display" name="ast-hfb-below-header-display" value="disabled" <?php checked( $below_header, 'disabled' ); ?> /> <label for="ast-hfb-below-header-display"><?php esc_html_e( 'Disable Below Header', 'astra' ); ?></label> <br /> </div> <?php endif; ?> <?php if ( $show_meta_field && Astra_Builder_Helper::is_row_empty( 'primary', 'header', 'mobile' ) || Astra_Builder_Helper::is_row_empty( 'above', 'header', 'mobile' ) || Astra_Builder_Helper::is_row_empty( 'below', 'header', 'mobile' ) ) : ?> <div class="ast-hfb-mobile-header-display-option-wrap"> <input type="checkbox" id="ast-hfb-mobile-header-display" name="ast-hfb-mobile-header-display" value="disabled" <?php checked( $mobile_header, 'disabled' ); ?> /> <label for="ast-hfb-mobile-header-display"><?php esc_html_e( 'Disable Mobile Header', 'astra' ); ?></label> <br /> </div> <?php endif; ?> <?php do_action( 'astra_meta_box_markup_disable_sections_after_primary_header', $meta ); ?> <?php if ( $show_meta_field ) { ?> <div class="site-post-title-option-wrap"> <label for="site-post-title"> <input type="checkbox" id="site-post-title" name="site-post-title" value="disabled" <?php checked( $site_post_title, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Title', 'astra' ); ?> </label> </div> <?php $ast_breadcrumbs_content = astra_get_option( 'ast-breadcrumbs-content' ); if ( 'disabled' != $ast_breadcrumbs_content && 'none' !== astra_get_option( 'breadcrumb-position' ) ) { ?> <div class="ast-breadcrumbs-content-option-wrap"> <label for="ast-breadcrumbs-content"> <input type="checkbox" id="ast-breadcrumbs-content" name="ast-breadcrumbs-content" value="disabled" <?php checked( $breadcrumbs_content, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Breadcrumb', 'astra' ); ?> </label> </div> <?php } ?> <div class="ast-featured-img-option-wrap"> <label for="ast-featured-img"> <input type="checkbox" id="ast-featured-img" name="ast-featured-img" value="disabled" <?php checked( $ast_featured_img, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Featured Image', 'astra' ); ?> </label> </div> <?php } ?> <?php $footer_adv_layout = astra_get_option( 'footer-adv' ); if ( $show_meta_field && ( 'disabled' != $footer_adv_layout && ! Astra_Builder_Helper::$is_header_footer_builder_active ) ) { ?> <div class="footer-adv-display-option-wrap"> <label for="footer-adv-display"> <input type="checkbox" id="footer-adv-display" name="footer-adv-display" value="disabled" <?php checked( $footer_widgets, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Footer Widgets', 'astra' ); ?> </label> </div> <?php } $footer_sml_layout = astra_get_option( 'footer-sml-layout' ); if ( 'disabled' != $footer_sml_layout || Astra_Builder_Helper::$is_header_footer_builder_active ) { ?> <div class="footer-sml-layout-option-wrap"> <label for="footer-sml-layout"> <input type="checkbox" id="footer-sml-layout" name="footer-sml-layout" value="disabled" <?php checked( $footer_bar, 'disabled' ); ?> /> <?php esc_html_e( 'Disable Footer', 'astra' ); ?> </label> </div> <?php } ?> <?php do_action( 'astra_meta_box_markup_disable_sections_after', $meta ); ?> </div> </div> <?php do_action( 'astra_meta_box_markup_after', $meta ); }
Expand full source code Collapse full source code View on Trac