Browse: Home / Hooks /

learndash_assignment_check_upload

apply_filters( 'learndash_assignment_check_upload',  bool $assignment_approved,  array $uploadfiles,  int $post_id,  array $post_settings )

Filter to allow external approval of Assignment upload.


Description #


Parameters #

$assignment_approved

(bool) If Assignment has been approved. Default true.

$uploadfiles

(array) Array of uploaded files.

$post_id

(int) Assignment Post ID.

$post_settings

(array) Array of Assignment Post Settings.


Return #

(bool) true if upload is approved. false if not. The external processor should set a usermeta entry 'ld_assignment_message' with the error message. This will be shown to the user. Example: update_user_meta( get_current_user_id(), 'ld_assignment_message', array( array( 'type' => 'error', 'message' => esc_html__( 'Number of allowed assignment uploads reached.', 'learndash' ), ), ) );


Source #

File: includes/ld-assignment-uploads.php


Changelog #

Changelog
Version Description
3.4.0 Introduced.