Skip to content

Commit

Permalink
More cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauteri committed Sep 10, 2024
1 parent df0ee73 commit 6c7533f
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions includes/core/classes/class-event-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,35 +333,6 @@ public function validate_timezone( string $param ): bool {
return in_array( Utility::maybe_convert_utc_offset( $param ), Utility::list_timezone_and_utc_offsets(), true );
}

/**
* Update the custom event table with start and end Datetime.
*
* This method is used to update the custom event table with new start and end Datetimes for a specific event.
* It checks the user's capability to edit posts before making any changes. If the user doesn't have the required
* capability, the method returns a response with 'success' set to false.
*
* @since 1.0.0
*
* @param WP_REST_Request $request Contains data from the request.
* @return WP_REST_Response The response indicating the success of the operation.
*
* @throws Exception When an exception occurs during the process.
*/
public function update_datetime( WP_REST_Request $request ): WP_REST_Response {
$params = wp_parse_args( $request->get_params(), $request->get_default_params() );
$params['timezone'] = Utility::maybe_convert_utc_offset( $params['timezone'] );
$event = new Event( $params['post_id'] );

unset( $params['post_id'] );

$success = $event->save_datetimes( $params );
$response = array(
'success' => $success,
);

return new WP_REST_Response( $response );
}

/**
* Send an event email notification to members.
*
Expand Down

0 comments on commit 6c7533f

Please sign in to comment.