wprig
wprig copied to clipboard
Question: What's a recommended way to remove a custom action added by the Component?
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?
Okay, I've found a solution provided by @hellofromtonya : https://gist.github.com/hellofromtonya/7b6b6e1fdf13da3e05181f21865ddb78
Hope this helps.