Astra_Builder_Admin::migrate_to_builder()

Migrate to New Header Builder


Description


Source

File: inc/core/builder/class-astra-builder-admin.php

	public function migrate_to_builder() {

		check_ajax_referer( 'astra-builder-module-nonce', 'nonce' );

		if ( ! current_user_can( 'manage_options' ) ) {
			wp_send_json_error( __( 'You don\'t have the access', 'astra' ) );
		}

		$migrate = isset( $_POST['value'] ) ? sanitize_key( $_POST['value'] ) : '';
		$migrate = ( $migrate ) ? true : false;
		/** @psalm-suppress InvalidArgument */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
		$migration_flag = astra_get_option( 'v3-option-migration', false );
		astra_update_option( 'is-header-footer-builder', $migrate );
		if ( $migrate && false === $migration_flag ) {
			astra_header_builder_migration();
		}
		wp_send_json_success();
	}


User Contributed Notes

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