Php 访问Wordpress插件';s模板方法
我是PHP新手,试图通过Wordpress学习。在我的主题的functions.php文件中,我想访问bbPress的plugin template.php文件中提供的方法。我收到了“意外令牌[” 在bbPress plugin template.php中:Php 访问Wordpress插件';s模板方法,php,wordpress,Php,Wordpress,我是PHP新手,试图通过Wordpress学习。在我的主题的functions.php文件中,我想访问bbPress的plugin template.php文件中提供的方法。我收到了“意外令牌[” 在bbPress plugin template.php中: function bbp_topic_reply_count( $topic_id = 0, $integer = false ) { echo bbp_get_topic_reply_count( $topic_id, $inte
function bbp_topic_reply_count( $topic_id = 0, $integer = false ) {
echo bbp_get_topic_reply_count( $topic_id, $integer );
}
我正在当前主题的functions.php中访问此函数:
$count = bbp_topic_reply_count(125);
我是否必须包含插件中的任何内容(如bbpress/template.php)?访问这些模板方法的正确方法是什么
谢谢。我想问题是因为在我的functions.php中没有处理“echo”语句
调用bbp\u get\u topic\u reply\u count()解决了我的问题。我认为问题是由于“echo”语句造成的,它没有在我的functions.php中处理 调用bbp\u get\u topic\u reply\u count()解决了我的问题