我想删除一个通道中的所有数据。而且我发现,要删除频道的所有入口最好的办法是删除该通道并重新创建它按照本文: https://expressionengine.stackexchange.com/questions/7648/what-is-the-best-way-to-delete-every-entry-in-a-channel删除通道中的每个条目 - 表达式引擎
,我试图删除频道关注这篇文章: http://ellislab.com/expressionengine/user-guide/development/api/api_channel_structure.html
我知道SITE_ID是1和通道的,我需要删除CHANNEL_ID为1 但是,当我尝试这些代码:
ee()->load->library('api'); ee()->api->instantiate('channel_structure');
$channel_id = 1;$site_id = 1;
ee()->api_channel_structure->delete_channel((int) $channel_id, [(int) $site_id]);
我得到这个错误:
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/au/admin/expressionengine/libraries/Functions.php(679) : eval()'d code on line 7
我试着用:
ee()->api_channel_structure->delete_channel((int) 1, [(int) 1]);
ee()->api_channel_structure->delete_channel(1, 1);
但得到了同样的问题。
有人知道如何解决这个问题。非常感谢!
如果您没有得到您希望的回复,我建议您在专用的EE网站上发布:http://expressionengine.stackexchange.com/ – AllInOne