Skip to:

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4195 closed defect (bug) (no action required)

functions tied to "init" action do not run

Reported by: dbvista's profile dbvista Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.5
Component: Core Keywords:


We’re running WordPress 3.3.2. After upgrading BuddyPress to 1.5.5, some of the functions in our WordPress plugins have stopped running if they hook WordPress’s “init” action. For example, in this code:

function foo() {
add_action("init", "foo");

the strings “one” and “three” get written to the error log (proving that the PHP file is being loaded), but “two” never happens. This problem is also mentioned on StackOverflow:

Change History (4)

#1 @dbvista
12 years ago

Previously we were running Version 1.2.8.

#2 @boonebgorges
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The problem appears to be with the BuddyPress Wiki Component, and in particular with the way that this plugin loads itself. Its main loader function is hooked to bp_init, which is too late. It should be hooked to bp_include. See

You may consider contacting the author of the plugin, to see if he plans to update it for BP 1.5 compatibility.

#3 @dbvista
12 years ago

Thank you very much. We are not running BuddyPress Wiki, but our other plugins were also using bp_init.

#4 @boonebgorges
12 years ago

We are not running BuddyPress Wiki, but our other plugins were also using bp_init.

Yeah, a pretty fair number of plugins are. The truth is that using bp_init works fine in most cases - unless you *also* try to hook an internal function to init. (The reason is because bp_init is itself hooked to init at priority 10, which creates a race condition that the hooked function often loses.) This is one of the reasons why bp_include was introduced around BP 1.2.6.

Note: See TracTickets for help on using tickets.