JDGrimes / wpppb

Bootstrap for integration testing WordPress plugins with PHPUnit
MIT License
13 stars 3 forks source link

Plugins not loaded when requested to be network activated #8

Closed JDGrimes closed 8 years ago

JDGrimes commented 8 years ago

They are installed properly, but not loaded, because muplugins_loaded isn't called until after the network-activated plugins are loaded. So we need to find something else to hook to, that fire's earlier.

JDGrimes commented 8 years ago

I found that enable_wp_debug_mode_checks is the first thing that gets called, although it was just introduced in 4.6, so I'm not sure if we want to use that yet.

After that, this is what gets called before muplugins_loaded:

query
wp_doing_ajax
pre_option_siteurl
query
option_siteurl
wp_doing_ajax
query
wp_doing_ajax
pre_option_siteurl
option_siteurl
wp_doing_ajax
query
wp_doing_ajax
pre_option_siteurl
option_siteurl

Possibly the best thing for us to do is just hook to all, but then remove ourselves after the first time it is called. That will guarantee us to get called early.