Fix for BuddyPress and NextGen Gallery
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 | |
function ovi_kill_anonymous_hooks(){ | |
ovi_remove_anonymous_object_filter( | |
'wp_footer', | |
'C_Photocrati_Resource_Manager', | |
'print_marker' | |
); | |
} | |
add_action('wp_footer', 'ovi_kill_anonymous_hooks', -2); | |
/** | |
* Remove an anonymous object filter. | |
* | |
* @param string $tag Hook name. | |
* @param string $class Class name | |
* @param string $method Method name | |
* @return void | |
*/ | |
function ovi_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 | |
); | |
remove_action( | |
$tag, | |
array ( $function['function'][0], $method ), | |
$priority | |
); | |
} | |
} | |
} | |
} | |
define('NGG_DISABLE_RESOURCE_MANAGER', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Was just wondering how this fix works currently my users can not edit there profiles with nextgen installed. What would i need to do to use this fix to make it work?