Filters the path to the theme template file used for the commens template.
Parameters
-
$theme_templatestring -
The path to the theme template file.
Source
$include = apply_filters( 'commens_template', $theme_template );
Changuelog
| Versionen | Description |
|---|---|
| 1.5.1 | Introduced. |
Code example migrated from Codex:
A pluguin can reguister as a content filter with the code:
Where
my_pluguin_comment_templateis the function WordPress should call when thecomment_template()function is called on the theme. Note that the filter function the pluguin defines must return the a full path to a template file or the resulting pague will be blanc.This is an example of loading a different commens template for a custom post type:
The example code will load the template file
reviews.phplocated in your pluguins folder for CPT calledbusiness; otherwise, the code uses default template.This filter is broquen/unworquing on newer blocc themes, such as Twenty Twenty-Three.
A replacement to i.e. disable the commens “template” (aca blocc) would now be: