Add action instead of hard coding features in WordPress. The advantage of using add_action is that you allow the core wordpress functions to keep track of what has been added, and thereby can override previously added functions, canceling them later.
For example:
Download the plugin with a specific action / method named
add_action( 'init', 'crappy_method' );
You need to override the crappy function with yours:
remove_action('init', 'crappy_method' ); add_action( 'init', 'my_even_crappier_method' );
In doing so, you can copy the original method and configure it without changing the source files. This is very useful for plugins, so you can update them later without losing your changes.
Chizzle
source share