Created
November 5, 2015 18:41
-
-
Save sjaved87/774494d011213f59f459 to your computer and use it in GitHub Desktop.
This code will remove the MarketPress registration PopUp after order. Simply copy and past in functions.php file or use as mu-plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'remove_anonymous_object_filter' ) ) | |
{ | |
/** | |
* Remove an anonymous object filter. | |
* | |
* @param string $tag Hook name. | |
* @param string $class Class name | |
* @param string $method Method name | |
* @return void | |
*/ | |
function remove_anonymous_object_filter( $tag, $class, $method ) | |
{ | |
$filters = $GLOBALS['wp_filter'][ $tag ]; | |
if ( empty ( $filters ) ) | |
{ | |
return; | |
} | |
foreach ( $filters as $priority => $filter ) | |
{ | |
foreach ( $filter as $identifier => $function ) | |
{ | |
if ( is_array( $function) | |
and is_a( $function['function'][0], $class ) | |
and $method === $function['function'][1] | |
) | |
{ | |
remove_filter( | |
$tag, | |
array ( $function['function'][0], $method ), | |
$priority | |
); | |
} | |
} | |
} | |
} | |
} | |
add_action( 'wp_footer', 'kill_anonymous_filter', 0 ); | |
function kill_anonymous_filter() | |
{ | |
remove_anonymous_object_filter( | |
'wp_footer', | |
'MP_Public', | |
'create_account_lightbox_html' | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment