learndash_allowed_repeats

apply_filters( 'learndash_allowed_repeats',  int $repeats,  int $user_id,  int $quiz_id )

Filters number of quiz attempts allowed for a user.


Description #


Parameters #

$repeats

(int) Number of quiz attempts allowed.

$user_id

(int) User ID.

$quiz_id

(int) Quiz ID.


Source #

File: includes/course/ld-course-progress.php


Examples #

 <?php
/**
 * Example usage for learndash_allowed_repeats filter.
 */
add_filter(
	'learndash_allowed_repeats',
	function( $repeats, $user_id, $quiz_id ) {
		// May add any custom logic using $repeats, $user_id, $quiz_id.

		// Always return $repeats.
		return $repeats;
	},
	10,
	3
);