WordPress函数get_comments_popup_template()

描述:

检索当前模板或父模板的评论弹出式菜单的路径。该函数判断弹出式菜单模板在当前模板或是在父模板中。若弹出式菜单不在当前模板中,函数在默认主题中检索comment-popup.php文件。默认主题必须能够运行该函数。

用法:

<?php get_comments_popup_template() ?>

参数:

None

源文件:

/**
 * Retrieve path of comment popup template in current or parent template.
 *
 * Checks for comment popup template in current template, if it exists or in the
 * parent template.
 *
 * The template path is filterable via the dynamic {@see '$type_template'} hook,
 * e.g. 'commentspopup_template'.
 *
 * @since 1.5.0
 *
 * @see get_query_template()
 *
 * @return string Full path to comments popup template file.
 */
function get_comments_popup_template() {
	$template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );

	// Backward compat code will be removed in a future release.
	if ('' == $template)
		$template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';

	return $template;
}