Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Created May 2, 2020 14:01
Show Gist options
  • Save dotherightthing/3fc780b3cd73f3232c3778f379a3cc90 to your computer and use it in GitHub Desktop.
Save dotherightthing/3fc780b3cd73f3232c3778f379a3cc90 to your computer and use it in GitHub Desktop.
Pluggable function #wordpress #cheatsheet #hooks #filters
/**
* Pluggable function
* Allows the function to be overridden/replaced
*
* This technique is only useful if the function
* is not attached to an 'action' or 'filter' hook
* as those can be overridden,
* or removed via remove_action() or remove_filter()
*
* @see http://wpcandy.com/teaches/custom-hooks-and-pluggable-functions/#.WZFYh3cjFlc
* @example
* if ( ! function_exists( 'wpdtrt_pluggable_function' ) ) {
* // code that may be overridden
* }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment