thomasgriffin/TGM-Plugin-Activation — Issue #59: Allow use of class extended from TGM_Plugin_Activation
Author: GaryJones
Created: 2011-10-19 11:10:42+00:00
State: open

Although the main class can be extended, the `tgmpa()` function forces the registration through our main class.

Consider adding a filter inside `tgmpa()` which can change the name of the called class.
Developers can then add an `add_filter()` line, and a function which returns the name of their extended class.

---

The current alternative to doing this, is that a developer would need to write their own equivalent of `tgmpa()` which calls their own class, and reference that new function name when they register the plugins. In this case, `tgmpa()` isn't a complicated function, but duplication of code is bad.

---

Perhaps the best solution would be to allow the name of a class to be passed in via the `$config` array, which can be pulled out immediately (and unset from `$config`), and use that to register the plugins and the remaining configurations. Unfortunately, the use of the scope resolution operator(::) with a variable is not supported until PHP 5.3.0, so this is currently a no-go, unless there's a workaround.