comments_template WordPress Filter Hook

The comments_template hook is used to load the comments template. This hook is used by the comments_template() function. The function has the following signature: comments_template( $file, $separate_comments ); The $file parameter is the path to the comments template. The $separate_comments parameter is a boolean value that determines whether the comments are displayed in a separate template. The comments_template hook is called in the following situations: When the comments_template() function is called When the wp_comments_template() function is called When the comments_array() function is called When the get_comments() function is called This hook is useful for loading a custom comments template.

apply_filters( 'comments_template', string $theme_template ) #

Filters the path to the theme template file used for the comments template.


Parameters

$theme_template

(string)The path to the theme template file.


Top ↑

More Information

The comments_template filter can be used to load a custom template form a plugin which replaces the theme’s default comment template.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More