Support » Plugins and Hacks » Rating programmatically a new article with GD Star Rating
4 years, 8 months ago
I’m looking to programmatically rate a post just after it’s creation.
The process is the following
The post is created, commented and rated in a single action after a post sumbit.
$vote = $_POST['gdsr_int_value'];
$post_id = wp_insert_post($arg);
$comment_id = wp_insert_comment($data);
What would be the code for the rating in that script?
Thanks for your help.
I’ve got it partially:
gdsrBlgDB::save_vote($post_id, $user_ID, $ip, $ua, $vote);
Now I need to see the rating for the post for each voter near their comment. So I need to find the missing class part to call.
I think I’ve got it:
gdsrBlgDB::save_vote($post_id, $user_ID, $ip, $ua, $vote, $comment_id);
Insert in the theme