learndash_approve_assignment

apply_filters( 'learndash_approve_assignment',  boolean $approve,  int $user_id,  int $lesson_id,  int $assignment_post_id )

Filters whether an assignment should be approved or not.


Description #


Parameters #

$approve

(boolean) Whether assignment should be approved or not.

$user_id

(int) User ID.

$lesson_id

(int) Lesson ID.

$assignment_post_id

(int) Assignment ID. @since 2.5.5


Source #

File: includes/ld-assignment-uploads.php


Examples #

 <?php
/**
 * Example usage for learndash_approve_assignment filter.
 */
add_filter(
	'learndash_approve_assignment',
	function( $approve, $user_id, $lesson_id, $assignment_post_id ) {
		// May add any custom logic using $approve, $user_id, $lesson_id, $assignment_post_id.

		// Always return $approve.
		return $approve;
	},
	10,
	4
);
 

Changelog #

Changelog
Version Description
2.1.0 Introduced.