Best way to add extra functionality to an existing plugin?
-
Hi,
Let’s say I developed this existing plugin (free) with basic functionality. I would like to add extra functionality and make it a paid plugin.
So what’s the best way to maintain these 2 plugins?
I think there are 2 ways to do it, it’s just I’m not sure which way is the best.
1. extends class or
2. apply_filtersMethod 1.
class MySetting { public function somefunction() { } } class PremiumSettings extends MySetting { public function somefunction() { parent::somefunction(); //add some extra functionality here } } $settings = PremiumSettings();
or Method 2.
instead of extending MySetting class, I’ll add do_action or apply_filters to all of my functions in MySetting, then I’ll just call add_action, add_filter and use the hook to add functionality.
So which way is the best? Please advise
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Best way to add extra functionality to an existing plugin?’ is closed to new replies.