我想执行自定义 PHP 脚本,该脚本将删除特定类型的所有节点(Feed 项)。如何使用 PHP 输入格式创建一个新节点,以便我可以将代码粘贴到节点正文中?请指定详细步骤。
$node_type = 'Feed items';
//fetch the nodes we want to delete
$result = db_query("SELECT nid FROM {node} WHERE type='%s'",$node_type);
while ($row = db_fetch_object($result)){
node_delete($row->nid);
$deleted_count+=1;
}
//simple debug message so we can see what had been deleted.
drupal_set_message("$deleted_count nodes have been deleted");