WordPress.org

Support

Support » Plugins and Hacks » Rating programmatically a new article with GD Star Rating

Rating programmatically a new article with GD Star Rating

  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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
    wp_gdsr_comment_integrate_standard_result(get_comment_ID());

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rating programmatically a new article with GD Star Rating’ is closed to new replies.
Skip to toolbar