Astra_PB_Compatibility::update_meta_values( int $id )

Update meta values


Description


Parameters

$id

(int) (Required) Post id.


Return

(void)


Source

File: inc/theme-update/class-astra-pb-compatibility.php

		public function update_meta_values( $id ) {

			$layout_flag = get_post_meta( $id, '_astra_content_layout_flag', true );
			if ( empty( $layout_flag ) ) {
				$site_content = get_post_meta( $id, 'site-content-layout', true );

				if ( 'default' == $site_content ) {
					$post_type = get_post_type( $id );
					if ( 'page' == $post_type ) {
						$site_content = astra_get_option( 'single-page-content-layout', '' );
					} elseif ( 'post' == $post_type ) {
						$site_content = astra_get_option( 'single-post-content-layout', '' );
					}

					if ( 'default' == $site_content ) {
						$site_content = astra_get_option( 'site-content-layout', '' );
					}
				}

				$elementor = get_post_meta( $id, '_elementor_edit_mode', true );
				$vc        = get_post_meta( $id, '_wpb_vc_js_status', true );
				if ( 'page-builder' === $site_content ) {
					update_post_meta( $id, '_astra_content_layout_flag', 'disabled' );
					update_post_meta( $id, 'site-post-title', 'disabled' );
					update_post_meta( $id, 'ast-title-bar-display', 'disabled' );
					update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' );
				} elseif ( 'builder' === $elementor || true === $vc || 'true' === $vc ) {
					update_post_meta( $id, '_astra_content_layout_flag', 'disabled' );
				}
			}
		}

Changelog

Changelog
Version Description
1.0.13 Introduced.

User Contributed Notes

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