# assistant/0.7.0.9/backend/src/Hooks/Actions/OnCustomizeRegister.php

Assistant – Every Day Productivity Apps, version 0.7.0.9. 39 lines.

- Page: https://pluginprobe.com/plugins/assistant/0.7.0.9/code/backend/src/Hooks/Actions/OnCustomizeRegister.php
- Raw: https://pluginprobe.com/plugins/assistant/0.7.0.9/raw/backend/src/Hooks/Actions/OnCustomizeRegister.php
- Modified: 2021-09-30T19:32:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/assistant/0.7.0.9/code/backend/src/Hooks/Actions/OnCustomizeRegister.php#L10-L20`.

```php
<?php

namespace FL\Assistant\Hooks\Actions;

use FL\Assistant\Services\CustomizerService;

/**
 * Class OnCustomizeRegister
 * @package FL\Assistant\Hooks\Actions
 */
class OnCustomizeRegister {

	public function __invoke() {
		$this->init_customizer_requests();
	}

	protected function init_customizer_requests() {
		if ( current_user_can( 'edit_theme_options' ) ) {

			if ( isset( $_POST['fl_assistant_export'] ) && is_numeric( $_POST['fl_assistant_export'] ) ) {

				$id = absint( $_POST['fl_assistant_export'] );
				$service = new CustomizerService();
				$response = $service->export_to_cloud( $id );

				wp_send_json( $response );

			} else if ( isset( $_POST['fl_assistant_import'] ) && is_numeric( $_POST['fl_assistant_import'] ) ) {

				$id = absint( $_POST['fl_assistant_import'] );
				$service = new CustomizerService();
				$response = $service->import_from_cloud( $id );

				wp_send_json( $response );
			}
		}
	}
}

```
