Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change priority of connectors load to be after widgets_init #532

Merged
merged 2 commits into from
May 15, 2014

Conversation

frankiejarrett
Copy link
Contributor

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.

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 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!

@shadyvb
Copy link
Contributor

shadyvb commented May 15, 2014

@fjarrett /megafive!

frankiejarrett added a commit that referenced this pull request May 15, 2014
Change priority of connectors load to be after widgets_init
@frankiejarrett frankiejarrett merged commit 761d53a into develop May 15, 2014
@frankiejarrett frankiejarrett deleted the issue-531 branch May 15, 2014 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget records show sidebar slug instead of label
2 participants