wprig icon indicating copy to clipboard operation
wprig copied to clipboard

Question: What's a recommended way to remove a custom action added by the Component?

Open dashkevych opened this issue 5 years ago • 1 comments

I am wondering what is the best to remove a custom a custom action added by the Component.

For example, the theme can have a custom Component with the following code snippet:

public function initialize() {
  add_action( 'slug_header_content', [ $this, 'set_header_content' ] );
}

I was trying the following solution but it does not work:

remove_action( 'slug_header_content', [ 'WPRIG\WPRIG\Theme_Templates\Component', 'set_header_content' ] );

Has anyone had experience working with custom actions and wprig?

dashkevych avatar Oct 15 '19 02:10 dashkevych

Okay, I've found a solution provided by @hellofromtonya : https://gist.github.com/hellofromtonya/7b6b6e1fdf13da3e05181f21865ddb78

Hope this helps.

dashkevych avatar Oct 31 '19 17:10 dashkevych