我只想问一个简单的,但真正的窃听问题的文件时,让我们TOT点Retun 1需要WordPress的
为什么当我写在的add_filter需要()它返回在不需要1个整数文本结尾?这是代码
function satufu_template($satufu_content){
if (is_singular('satufu_projects')){
$located = locate_template('satufu-template.php');
if (!empty($located)){
} else {
echo require plugin_dir_path(__FILE__) . 'template.php';
}
} else {
return $satufu_content;
}
}
add_filter('the_content','satufu_template');
这是我需要
typo<?php
echo $satufu_content;
这是输出
test
//SomeMyAwesomeContent
1
这是用的var_dump()包装输出模板文件
test
//SomeMyAwesomeContent
int(1)
这是一个简单的1整数,毁了我的生活(嗯,我试了2天,只是为了调试这个,直到我放弃。
所以,谢谢你的关注和真的希望这真棒论坛会杀了这个小错误:)
是使用'测试
2015-04-05 09:50:02
不,这不是答案:),它只是我的问题 – 2015-04-05 09:53:40