handling rating properly
This commit is contained in:
parent
f218280d0b
commit
b710fcd5fd
|
|
@ -360,12 +360,13 @@ function lhoist_post_rating(WP_REST_Request $request)
|
||||||
$cleanDatas = lhoist_sanitize_ratings_datas($datas);
|
$cleanDatas = lhoist_sanitize_ratings_datas($datas);
|
||||||
lhoist_check_ratings_datas_formats($cleanDatas);
|
lhoist_check_ratings_datas_formats($cleanDatas);
|
||||||
|
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$datetime = new DateTime("now", new DateTimeZone('Europe/Brussels'));
|
$datetime = new DateTime("now", new DateTimeZone('Europe/Brussels'));
|
||||||
|
|
||||||
$ratingsDatas = array(
|
$ratingsDatas = array(
|
||||||
'comment' => "super",
|
'rating' => $cleanDatas['note'],
|
||||||
'rating' => 3,
|
'comment' => $cleanDatas['comment'] ?? '',
|
||||||
'date' => $datetime->format('Y-m-d H:i:s'),
|
'date' => $datetime->format('Y-m-d H:i:s'),
|
||||||
);
|
);
|
||||||
$table_name = 'wp_app_ratings';
|
$table_name = 'wp_app_ratings';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user