Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save HeyMehedi/4003fd88e4ef5ccc56e1d63691ebc392 to your computer and use it in GitHub Desktop.

Select an option

Save HeyMehedi/4003fd88e4ef5ccc56e1d63691ebc392 to your computer and use it in GitHub Desktop.
function remove_class_action ($action,$class,$method) {
global $wp_filter ;
if (isset($wp_filter[$action])) {
$len = strlen($method) ;
foreach ($wp_filter[$action] as $pri => $actions) {
foreach ($actions as $name => $def) {
if (substr($name,-$len) == $method) {
if (is_array($def['function'])) {
if (get_class($def['function'][0]) == $class) {
if (is_object($wp_filter[$action]) && isset($wp_filter[$action]->callbacks)) {
unset($wp_filter[$action]->callbacks[$pri][$name]) ;
} else {
unset($wp_filter[$action][$pri][$name]) ;
}
}
}
}
}
}
}
}
remove_class_action( 'atbdp_all_listings_badge_template', 'Claim_Post_Type_Manager', 'atbdp_all_listings_badge_template' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment