I want to use a method from a plugin as a hook, not the callback. I want to use a custom function I wrote as the callback, that gets triggered when a particular method from a plugin runs. Essentially something like :
add_action( array( "NAME OF CLASS", NAME OF METHOD" ), "MY CUSTOM FUNCTION" ) )
I can't figure out how to do this, any help or direction would be greatly appreciated!
I've verified the method and class exist in functions.php with the method_exists() function.
I'm using plugins called Groups and Groups_File_Access to handle file access and downloads on my site. The class is "Groups_File_Access"" and the method inside is "groups_file_served". I did not write this plugin. That method gets triggered when someone accesses a file and I want to run a custom function when "groups_file_served" get called by hooking onto it. Was trying to avoid editing the plugin itself, but looks like I'm going to need to.