WordPress.org

Forums

Rating programmatically a new article with GD Star Rating (3 posts)

  1. fvl2000
    Member
    Posted 3 years 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.

  2. fvl2000
    Member
    Posted 3 years ago #

    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.

  3. fvl2000
    Member
    Posted 3 years ago #

    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());

Topic Closed

This topic has been closed to new replies.

About this Topic