我想删除一个频道中的所有数据。我发现,删除通道中所有条目的最佳方法是删除该通道并重新创建它,如下所示:https://expressionengine.stackexchange.com/questions/7648/what-is-the-best-way-to-delete-every-entry-in-a-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]);
我发现了一个错误:
解析错误:语法错误,第7行中的/var/www/vhosts/au/admin/expressionengine/libraries/Functions.php(679):eval()d代码中的意外T_STRING
我试过:
ee()->api_channel_structure->delete_channel((int) 1, [(int) 1]);
ee()->api_channel_structure->delete_channel(1, 1);
但也有同样的问题。
有人知道如何解决这个问题吗。太感谢了!
发布于 2014-01-15 15:52:19
在EE文档中,(int)
表示期望值是整数。此外,文档惯例是方括号表示可选值。
如果我正确阅读,这两种代码都不是代码的一部分。我想这就是你想要的:
ee()->load->library('api');
ee()->api->instantiate('channel_structure');
$channel_id = 1;
$site_id = 1;
ee()->api_channel_structure->delete_channel($channel_id, $site_id);
发布于 2014-06-13 15:39:16
尝试将&perpage=1000添加到编辑通道条目屏幕上查询字符串的末尾.
例如/admin.php?S=de47727e64b2e445cfee64c85a219977c9b62474&D=cp&C=content_edit&perpage=1000
如果内存不足,请使用较低的数字。
https://stackoverflow.com/questions/21086530
复制