xwp / wp-settings-revisions

Settings Revisions plugin for WordPress
http://wordpress.org/plugins/settings-revisions/
Other
25 stars 7 forks source link

Create base class which includes addFilter and addAction shortcuts #15

Open westonruter opened 11 years ago

westonruter commented 11 years ago

We can avoid having to always write out:

add_action( 'foo', array( $this, 'action_foo' ), 10, 3 );

And instead have something like this:

$this->addAction( 'foo', 'action_foo' );

We can use Reflection API to discern the argument count for the action_foo method, and just assume the callback will be a method of the current object.