x-team/wp-stream — pull request #532 by fjarrett (2014-05-15 17:05:50+00:00)
Title: Change priority of connectors load to be after widgets_init

Fixes #531

The problem was that you can't call `global $wp_registered_sidebars` until the `init` hook has fired with a priority of 1, which is when `wigets_init` happens. See the special note about `widgets_init` in the [Codex Action Reference](http://codex.wordpress.org/Plugin_API/Action_Reference).

So by loading connectors on `init` with a priority of 9 we are able to get the sidebar names correctly and also prevent regression on #501 because we only miss the user login/logout when using `init` with a priority 10.

I think it's better to fire as late as close to the default priority as we can rather than as far away from it as we can, just in case other plugins (or core) introduce globals on lower priorities that Stream would need.

No upgrade routine is needed for this as all previous records will now query the `get_context_labels` method successfully. MVC approach FTW!