__( 'Post Rated', 'advanced-form-integration' ), ); } // Get kk Star Ratings Fields function adfoin_kkstarratings_get_form_fields( $form_provider, $form_id ) { if ( $form_provider !== 'kkstarratings' || $form_id !== 'postRated' ) { return; } return array( 'post_id' => __( 'Post ID', 'advanced-form-integration' ), 'post_title' => __( 'Post Title', 'advanced-form-integration' ), 'post_url' => __( 'Post URL', 'advanced-form-integration' ), 'rating' => __( 'Rating (out of 5)', 'advanced-form-integration' ), 'fingerprint' => __( 'Visitor Fingerprint (anonymous)', 'advanced-form-integration' ), ); } // Handle Post Rated function adfoin_kkstarratings_handle_rate( $id, $out_of_5, $fingerprint ) { $integration = new Advanced_Form_Integration_Integration(); $saved_records = $integration->get_by_trigger( 'kkstarratings', 'postRated' ); if ( empty( $saved_records ) ) { return; } $posted_data = array( 'post_id' => $id, 'post_title' => get_the_title( $id ), 'post_url' => get_permalink( $id ), 'rating' => $out_of_5, 'fingerprint' => $fingerprint, ); adfoin_dispatch_integrations( $saved_records, $posted_data ); }