/** * This function is called after when some file was unlinked from item * * @param integer Link ID */ function after_unlink_action($link_ID = 0) { if (empty($this->Item)) { // No existing Item, Exit here return; } if (!empty($link_ID)) { // Find inline image placeholders if link ID is defined preg_match_all('/\\[(image|file|inline):' . $link_ID . ':?[^\\]]*\\]/i', $this->Item->content, $inline_images); if (!empty($inline_images[0])) { // There are inline image placeholders in the post content $this->Item->set('content', str_replace($inline_images[0], '', $this->Item->content)); $this->Item->dbupdate(); return; } } // Update last touched date of the Item $this->update_last_touched_date(); }