Automator_Review::save_review_settings( object $request )

Rest API callback for saving user selection for review.


Parameters Parameters

$request

(object) (Required)


Top ↑

Return Return

(object)


Source Source

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

	public function save_review_settings( $request ) {
		// check if its a valid request.
		$data = $request->get_params();
		if ( isset( $data['action'] ) && ( 'maybe-later' === $data['action'] || 'hide-forever' === $data['action'] ) ) {
			update_option( '_uncanny_automator_review_reminder', $data['action'] );
			update_option( '_uncanny_automator_review_reminder_date', current_time( 'timestamp' ) );

			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.