Multiple afters - #207
Multiple afters#207efc wants to merge 4 commits into
Conversation
Did you need this for your use case or did you add it just in case it is useful? |
|
The skipAfter was needed because one vendor implemented an after that actually was different enough from mine to end up with a different result. So I found I needed a way to disable their after and use mine as a substitute. In this case, since they did not use an identifier, I was able to use |
|
Running into this one again. I am using an addon that implements I really wish that multiple |
This implements a method of allowing more than one after callback, as requested in #182.
It adds an option
$idparameter to theSSG::aftermethod that defaults to"unidentified". This means that all existing calls toSSG::afterwill work as they always have, overwriting one another. However, if one supplies an identifier string, then the callback function will be added to an array of callback functions instead of overwriting previous after callbacks.One can also specify identifiers that should be skipped using the new
SSG::skipAftermethod. This allows you to explicitly prevent after callbacks from other parties from being run (for example, if you supply similar functionality yourself or you have found that their callback is incompatible with your use case).Finally, it uses the identifiers to inform the user which after callbacks are being run or skipped.
Note the reversion in
composer.jsonis probably not necessary, but was required to get the addon installed on my system.