Theme demo: pick a theme on the right. Log in as demo / demo to try posting. Everything resets every night.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Senior Member
****
263 28 Dec 2025 0 0
#1

Hooks are the heart of MyBB plugins —
Code: PHP
$plugins->add_hook('pre_output_page', 'my_func');
is where everything starts.

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

I did a bit of searching but could not find a recent thread on this, so here we go.
Reply
Administrator
*******
252 25 Jun 2026 0 0
#2

(09-17-2026, 08:48 AM)GamerGhoul Wrote: Hooks are the heart of MyBB plugins —
Code: PHP
$plugins->add_hook('pre_output_page', 'my_func');
is where everything starts.
Always call rebuild_settings() after changing settings programmatically.

The gid=0 trick keeps plugin settings out of the ACP — neat.

That has been my experience as well.

Bumping this because I ran into the same thing today.
Reply
Account not Activated
236 18 Oct 2026 0
#3

Always call rebuild_settings() after changing settings programmatically.

Nice plugin, testing it on my dev board now.

Nice thread, following for the replies.
Reply
Super Moderator
******
232 17 Mar 2026 0 0
#4

That hooks explanation finally made it click for me.

Nice thread, following for the replies.
Reply

Users browsing this thread: 1 Guest(s)

Forum Jump: