MyBB Community Forums

Full Version: how to add unapprove_posts in plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am making a bad word plugin.

on my condition i want to un-approve some post(s).

how to use this function in my plugin as no hook is provided for this

unapprove_posts(post_ids); [This function is in class_moderation.php]

How can I actually create a hook for this function so my plugin can call it?
Just include the class_moderation.php file, then instantiate a new instance of the Moderation class:

/* ... */

  require_once MYBB_ROOT."inc/class_moderation.php";
  $moderation = new Moderation();

/* ... */

Then you'll have access to the unapprove_posts function through $moderation.
thanks, it works