If I create a forum.php file and add the following code, members can see their and others' deleted thread:
I want members to only be able to see own deleted thread, how do I fix the code?
Thank you!
Code:
<?php
namespace ENXF\ViewDeleteThread\XF\Entity;
class Forum extends XFCP_Forum
{
public function canViewDeletedThreads()
{
$allowed = parent::canViewDeletedThreads();
if (!$allowed) {
if (\XF::visitor()->hasNodePermission($this->node_id, 'top_viewDeletedThreads')) {
$allowed = true;
}
}
return $allowed;
}
}
Thank you!