Automator_Review::save_tracking_settings( object $request )

Rest API callback for saving user selection for review.


Parameters Parameters

$request

(Required)


Top ↑

Return Return

(object)


Source Source

File: src/core/admin/class-automator-review.php

	public function save_tracking_settings( $request ) {
		// check if its a valid request.
		$data = $request->get_params();
		if ( isset( $data['action'] ) && 'tracking-settings' === $data['action'] ) {
			if( 'true' === $data['swtich'] ) {
				update_option( 'automator_reporting', true );
			} else {
				delete_option( 'automator_reporting' );
			}

			if( isset( $data['hide'] ) ) {
				update_option( '_uncanny_automator_tracking_reminder', 'hide-forever' );
			}

			return new WP_REST_Response( [ 'success' => true ], 200 );
		}

		return new WP_REST_Response( [ 'success' => false ], 200 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.4 Introduced.