Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
doAction when a deprecated feature is encountered #8110
Whenever a deprecated feature is encountered, an action should be fired. This is necessary for log deprecated notices to be able to easily log these deprecations or for other plugins to handle and do something when somethign deprecarted is encountered.
How has this been tested?
Added this js to the page:
There is also a unit test. ¯\(ツ)/¯
Types of changes
This adds a new dependency to the deprecated package. Not sure if this needs to be tested specially with packages or we need to do something special.
Can we also add documentation in
README file and a unit test before we merge this one?
What's the process by which we should decide when it's appropriate to introduce a new action? Is it simply a "that could be useful" consensus? Is there documentation for this even in how PHP hooks are introduced?
Edit: To be clear, I'm not objecting here. It just seems like we've been very ad hoc and inconsistent in how we're using hooks, which will be prone to misunderstanding and confusion.
There isn't a formal one for PHP Hooks right now. It's generally up to the committers if they think that the use case is one that can only be accomplished if a new hook is added and if that hook is unlikely in their mind to cause a loss of flexibility in the future.
My only remaining concern is the name of the action. In other places when we set up hooks we prefix them with the name of the package. In this case, the function is the default export for the package so I think it should be simply:
doAction( 'deprecated', feature, options, message );
Let's agree on that before we merge. It would be nice to include an actual example in README.md file, too. Otherwise, it looks great.