Astra_Addon_Update::update_header_layout_opts()

Set different page header logo option when page header logo is set


Description


Source

File: classes/class-astra-addon-update.php

		public static function update_header_layout_opts() {

			$query_args = array(
				'post_type'      => 'astra_adv_header',
				'posts_per_page' => -1,
				'fields'         => 'ids',
			);

			$adv_headers = new WP_Query( $query_args );

			if ( isset( $adv_headers->posts ) && ! empty( $adv_headers->posts ) ) {

				foreach ( $adv_headers->posts as $header ) {

					$adv_header_design = get_post_meta( $header, 'ast-advanced-headers-design', true );

					if ( ( isset( $adv_header_design['logo-id'] ) && '' !== $adv_header_design['logo-id'] ) || ( isset( $adv_header_design['retina-logo-id'] ) && '' !== $adv_header_design['retina-logo-id'] ) ) {

						$adv_header_opts = get_post_meta( $header, 'ast-advanced-headers-layout', true );

						$adv_header_opts['diff-header-logo'] = 'enabled';

						update_post_meta( $header, 'ast-advanced-headers-layout', $adv_header_opts );
					}
				}
			}

		}

Changelog

Changelog
Version Description
1.4.0 Introduced.

User Contributed Notes

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