Jump to content

delete content item directly without go to Deleted Content


Go to solution Solved by Ryan Ashbrook,

Recommended Posts

Posted

I have 2 content item types in my app and one of them I don't need to send it to ModCP -> Deleted Content when a moderator deletes it; I want to delete it right away.

Tried to return FALSE in logDelete() in this content item or even don't have a logDelete() method but both doesn't work.

How can I do that?

Thank you.

  • Solution
Posted

In your Content model, do something like this:

	/**
	 * Do Moderator Action
	 *
	 * @param	string				$action	The action
	 * @param	\IPS\Member|NULL	$member	The member doing the action (NULL for currently logged in member)
	 * @param	string|NULL			$reason	Reason (for hides)
	 * @param	bool				$immediately Delete Immediately
	 * @return	void
	 * @throws	\OutOfRangeException|\InvalidArgumentException|\RuntimeException
	 */
	public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL, $immediately = FALSE )
	{
		if ( $action === 'delete' )
		{
			$immediately = TRUE;
		}

		return parent::modAction( $action, $member, $reason, $immediately );
	}

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...