How to remove an action added through a class

I’m trying to remove an action that a plugin registers in a separate functions.php file, but the syntax is stumping me. The plugin (I can’t copy/paste – commercial plugin) infers to the add_action like so:

class Plugin_Class{

  function add_actions(){
    add_action('tag', array(&$this, 'function_to_remove'), 10); 
  }

  function_to_remove(){
    global $wp;
    // Code here
  }
}

I’m mostly confused with &$this. I know that this refers to the instance of the class, but based off my research it should be removed like so:

Read More

Need help with remove_action()

I just don’t know how to come up with the syntax for my situation. Why define the global variable? Would I need to do that in my case? I’m assuming the widget array comes from WP core code, but I’m confused on how I need to implement this in my case, which seems to be much simpler. Sorry if this stuff is remedial.

Thanks for any help in advance.

Related posts

Leave a Reply

1 comment