Astra_Theme_Update::v_1_0_28()

Update page meta settings for all the themer layouts which are not already set.


Description

Default settings to previous versions was no-sidebar and page-builder through filters.


Return

(void)


Source

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

		public static function v_1_0_28() {

			$query = array(
				'post_type'     => 'fl-theme-layout',
				'no_found_rows' => true,
				'post_status'   => 'any',
				'fields'        => 'ids',
			);

			// Execute the query.
			$posts = new WP_Query( $query );

			foreach ( $posts->posts as $id ) {

				$sidebar = get_post_meta( $id, 'site-sidebar-layout', true );

				if ( '' == $sidebar ) {
					update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' );
				}

				$content_layout = get_post_meta( $id, 'site-content-layout', true );

				if ( '' == $content_layout ) {
					update_post_meta( $id, 'site-content-layout', 'page-builder' );
				}
			}

		}

Changelog

Changelog
Version Description
1.0.28 Introduced.

User Contributed Notes

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