Skip to content

Commit

Permalink
Fix phpcs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hanifn committed Jun 19, 2024
1 parent 57a6806 commit 331166c
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions common/php/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,24 @@ function update_user_meta( $user_id, $key, $value, $previous = null ) {

}

/**
* Take a status and a message, JSON encode and print
*
* @since 0.7
*
* @param string $status Whether it was a 'success' or an 'error'
*/
function print_ajax_response( $status, $message = '', $http_code = 200 ) {
header( 'Content-type: application/json;' );
http_response_code( $http_code );
echo json_encode( array( 'status' => $status, 'message' => $message ) );
exit;
}
/**
* Take a status and a message, JSON encode and print
*
* @since 0.7
*
* @param string $status Whether it was a 'success' or an 'error'
*/
protected function print_ajax_response( $status, $message = '', $http_code = 200 ) {
header( 'Content-type: application/json;' );
http_response_code( $http_code );
echo wp_json_encode(
array(
'status' => $status,
'message' => $message,
)
);
exit;
}

/**
* Whether or not the current page is a user-facing Edit Flow View
Expand Down

0 comments on commit 331166c

Please sign in to comment.