learndash_essay_upload_filename

apply_filters( 'learndash_essay_upload_filename',  string $filename,  int $question_id,  string $filetitle,  string $extension )

Filters essay upload file name.


Description #

Used in migrate_file_upload_to_essay to migrate existing files to essays.


Parameters #

$filename

(string) Essay file name.

$question_id

(int) Question ID.

$filetitle

(string) File title.

$extension

(string) File extension.


Source #

File: includes/import/class-ld-import-quiz-statistics.php


Examples #

 <?php
/**
 * Example usage for learndash_essay_upload_filename filter.
 */
add_filter(
	'learndash_essay_upload_filename',
	function( $filename, $question_id, $filetitle, $extension ) {
		// May add any custom logic using $filename, $question_id, $filetitle, $extension.

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