Removing an action from an external plugin class

I am using a plugin that has this line of code to add an action from the Eazyest_Frontend class:

add_action( 'eazyest_gallery_thumbnails', 'ezg_thumbnails',5);

I want to remove that and do something a bit different without editing the plugin. I thought this added to my functions.php file might work:

global $eazyest_frontend;    
remove_action( 'eazyest_gallery_thumbnails', array($eazyest_frontend,'ezg_thumbnails'), 1, 1 );

I have maybe tried a hundred variations where I altered the priority etc but nothing works yet.

If I comment out the original add action line in the plugin, it does have the effect I am seeking so I seem to have identified the correct action.

I’m new to removing actions, how is it done?

Solutions Collecting From Web of "Removing an action from an external plugin class"

Maybe I got you wrong, but why don’t you just put the following line in your functions.php:

remove_action('eazyest_gallery_thumbnails', 'ezg_thumbnails');

If you have a class function hooked to an action, you can use the class name instead of the class object:

    array('EazyestFrontendClassName', 'ezg_thumbnails')

Right now, I don’t see why this wouldn’t be working. Just tried with an action from one of my plugins.

Thanks for all comments and answers – I just solved this:

function remove_eazyest_gallery() {
remove_action('eazyest_gallery_thumbnails',     'ezg_thumbnails', 5);
add_action( 'eazyest_gallery_ready', 'remove_eazyest_gallery', 1 );

Similar technique can be used to hide unwanted admin notices.

Find the name of the function creating the notice you want to remove, then add the following line to your child theme’s functions.php file:

remove_action( 'admin_notices', 'offending_function_that_is_creating_the_notice' );

Now, only that specific nag will be hidden while other (potentially important) notices from that plugin still get through. This will remain effective through future updates unless the plugin developer modifies the name of the function creating the nag (unlikely).