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

Supporting setups where Wordpress is not initialized immediately #2

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

benvoynick
Copy link
Contributor

Thank you for the nifty extension!

I ran into an issue trying to use this on a project where WordPress is not immediately initialized. If either add_filter() or WP_DEBUG is not yet defined, the chance to add the the relevant filters is missed and the extension is not used.

Here's a pull request that wraps the initialization code in a function. The extension should still work as before and automatically register if possible. But on projects where that doesn't work out, initialize_filters() can now be called manually in a spot where WordPress initialization can be counted on having happened. I've included a README update to document this.

…lled later if Wordpress and the add_filter function are not initialized when package is loaded
@djboris88 djboris88 merged commit 766098c into djboris88:master Sep 24, 2019
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.

2 participants