apply_filters( 'learndash_template_filename', string $template_filename, string $name, array|null $args, bool|null $echo, bool $return_file_path )
Filters template file name.
Description #
Parameters #
- $template_filename
-
(string) Template file name.
- $name
-
(string) Template name.
- $args
-
(array|null) Template data.
- $echo
-
(bool|null) Whether to echo the template output or not.
- $return_file_path
-
(bool) Whether to return file or path or not.
Source #
Examples #
Note: Extended code example below not guaranteed, you may need to consult with a developer
<?php
/**
* Example usage for learndash_template_filename filter.
*/
add_filter(
'learndash_template_filename',
function( $template_filename, $name, $args, $echo, $return_file_path ) {
// May add any custom logic using $template_filename, $name, $args, $echo, $return_file_path.
// Always return $template_filename.
return $template_filename;
},
10,
5
);
Changelog #
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |