-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Allow plugins themes do extra checks on upgrade #7338
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
base: trunk
Are you sure you want to change the base?
Allow plugins themes do extra checks on upgrade #7338
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Looking at the current patch, I'm wondering if there should be any sort of guardrails on the Extra props @afragen. |
|
Personally, I'd rather not guard against |
|
In any case, I've now added the guardrails of validating against being either a string or an error, which is already an improvement. As for guarding against the path being in I also pushed a change unifying the two new filters into one, as per feedback from @afercia . |
|
I need to review further but initially I don't think the final return should be Is it even possible for |
Indeed, I dont think it's possible to be an
I'm totally fine with removing the check, I was mostly trying to follow the advice above and guardrail the Which is basically why I'm returning a In any case, thanks for responding :) |
|
I think the only way a |
|
If we move up the filter to just before the checks for Will need to account for variables passed. |
|
Honestly, I'm still trying to see why The use cases outlined in https://core.trac.wordpress.org/ticket/62043 could work very easily with that existing hook. |
Because in order to achieve what this new filter allows us to do, we need access to the To give an example of how that new filter could be used: (consider that the So, the above code in the main plugin would prevent installations/upgrades of its add-on, if that add-on had a required version for the main plugin.
Yes, that exactly would be the way for that plugin to prevent an installation of an incompatible add-on version.
I'm failing to see how that could be the case 🤔 |
|
How does the following not achieve your goal? Using |
Trac ticket: https://core.trac.wordpress.org/ticket/62043
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.