Skip to content

Instantly share code, notes, and snippets.

@slaFFik
Created June 13, 2014 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaFFik/cbb1a8ee89062276604c to your computer and use it in GitHub Desktop.
Save slaFFik/cbb1a8ee89062276604c to your computer and use it in GitHub Desktop.
Fix for BuddyPress and NextGen Gallery
<?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);
@danield4226
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment