Zen Follower
- Join Date:
- Jun 2012
- Posts:
- 481
- Plugin Contributions:
- 0
Strategy when multiple observers inject content in admin/orders.php
There are several comments in admin/orders.php advising checking (for example) $extra_headings for (bool) false before initializing $extra_headings, since multiple observers might be injecting content. Suppose there ARE multiple observers from different add-ons injecting content. What strategy should be employed in this case? I suppose if $extra_headings is not (bool) false because observer A injected content, that observer B should add their content to $extra_headings, either at the beginning or end of the array depending on the desired order in the output. But how would an observer writer know the end users desired order? Another possibility might be for the user to control the loading order of the observers. It seems to me that guidance to observer writers is needed to avoid conflicts when $extra_headings is not (bool) false. Or perhaps guidance to users in add-on instructions. Thoughts anyone?