文件操作 - RemoveNode.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Framework/FieldsAPI/Concerns/RemoveNode.php
编辑文件内容
<?php namespace Give\Framework\FieldsAPI\Concerns; use Give\Framework\FieldsAPI\Contracts\Collection; trait RemoveNode { /** * @since 3.0.0 preserve array numeric keys * @since 2.10.2 * * @return static */ public function remove(string $name) { foreach ($this->nodes as $index => $node) { if ($node->getName() === $name) { unset($this->nodes[$index]); $this->nodes = array_values($this->nodes); return $this; } if ($node instanceof Collection) { return $node->remove($name); } } // Maybe need to throw an exception if no node is removed. return $this; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件