Course Reviews for LearnDash Actions & Filters for Developers - Honors WP

Actions & Filters for Developers

Actions & Filters for Developers

Course Reviews for LearnDash Filters

Change the Number of Displayed Reviews #

apply_filters( 'learndash_reviews_displayed_reviews', 5 );
  • Add this filter to change the number of reviews that will show when using the [ea_ld_reviews] shortcode and on course pages.

Hook After a Review is Submitted #

/**
 * Fires after a review has been submitted and the review post has been created
 *
 * @param WP_User $current_user Reviewer user object.
 * @param array   $rating_data  Review data used to create the review post.
 * @param int     $rating_post  Review Post ID.
*/
do_action( 'learndash_reviews_review_submitted', $current_user, $rating_data, $rating_post );

Simplified Pseudo Code #

add_action( 'learndash_reviews_review_submitted', function( $current_user, $rating_data, $rating_post) { 
wp_mail( 'admin@test.com', 'New Course Review submitted', `$current_user has submitted the following review: $rating_data.`);
}, 10, 3)
Shopping Cart
  • Your cart is empty.
Scroll to Top