Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Super Moderator
******
222 22 Feb 2026 0
#1

Returning true from a by-value hook replaces the argument; by-reference hooks mutate in place — check the call site.

Hooks are the heart of MyBB plugins — [code=php]$plugins->add_hook('pre_output_page', 'my_func');[/code] is where everything starts.

Remember: _activate() should be reversible, _install() owns permanent structures.

I did a bit of searching but could not find a recent thread on this, so here we go.
Reply
Super Moderator
******
203 23 Oct 2026 0
#2

That hooks explanation finally made it click for me.

Always call rebuild_settings() after changing settings programmatically.

Bumping this because I ran into the same thing today.
Reply
Member
***
210 15 Jan 2026 0
#3

That hooks explanation finally made it click for me.

The gid=0 trick keeps plugin settings out of the ACP — neat.
Reply
Member
***
215 13 Oct 2026 0
#4

Always call rebuild_settings() after changing settings programmatically.

I disagree slightly, but I can see where you are coming from.
Reply
Administrator
*******
196 13 Oct 2026 0
#5

Whitelist-based hooks debugging in class_plugins.php helped me a lot.

Always call rebuild_settings() after changing settings programmatically.
Reply
Member
***
204 17 Apr 2026 0
#6

Always call rebuild_settings() after changing settings programmatically.

Nice plugin, testing it on my dev board now.

That has been my experience as well.
Reply
Super Moderator
******
203 23 Oct 2026 0
#7

Nice plugin, testing it on my dev board now.

Nice thread, following for the replies.
Reply

Users browsing this thread: 2 Guest(s)

Forum Jump: