plugin_data_store = $plugin_data_store; } protected function get_nonce_name() { return self::ACTION_NAME; } public function handle() { if ( ! $this->validate() ) { wp_send_json_error( __( 'Missing required parameters.', 'gravitysmtp' ), 400 ); } $settings = filter_input( INPUT_POST, self::PARAM_SETTINGS, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); $this->plugin_data_store->save( self::PARAM_SETTINGS, $settings ); wp_send_json_success( $settings ); } }