Astra_Rollback_Version_Manager::render_rollback_version_form()

Display Theme Rollback to privious versions form.


Description


Source

File: admin/astra-rollback/class-astra-rollback-version-manager.php

	public function render_rollback_version_form() {
		add_action( 'admin_footer', array( $this, 'rollback_version_popup' ) );

		// Enqueue scripts only when this function is called.
		wp_enqueue_script( 'astra-version-rollback' );
		wp_enqueue_style( 'astra-version-rollback-css' );

		$theme_versions = Astra_Rollback_version::get_theme_all_versions();
		if ( empty( $theme_versions ) ) {
			echo esc_html__( 'No Versions Found! ', 'astra-addon' );
			return;
		}

		?>
		<select class="ast-rollback-version-select">
		<?php
		foreach ( $theme_versions as $version ) {
			?>
				<option value="<?php echo esc_attr( $version ); ?>"><?php echo esc_html( $version ); ?> </option>
			<?php
		}
		?>
		</select>
			<a data-placeholder-text=" <?php echo esc_html__( 'Rollback', 'astra-addon' ); ?>" href="<?php echo esc_url( add_query_arg( 'version_no', $theme_versions[0], wp_nonce_url( admin_url( 'index.php?action=astra_rollback' ), 'astra_rollback' ) ) ); ?>"
			data-placeholder-url="<?php echo esc_url( wp_nonce_url( admin_url( 'index.php?action=astra-rollback&version_no=VERSION' ), 'astra_rollback' ) ); ?>" class="button ast-rollback-button"><?php echo esc_html__( 'Rollback', 'astra-addon' ); ?> </a>
		</select>
		<?php
	}

Changelog

Changelog
Version Description
3.6.1 Introduced.


User Contributed Notes

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