Skip to content
Advertisement

WooCommerce membership plugin

In WooCommerce membership plugin there is a file with name class-wc-memberships-restrictions.php this file have the following class and constructor and that constructor have lots of filters, but I want to remove this filter from my child theme functions.php file

How can I remove this filter from child theme functions.php file

JavaScript

Advertisement

Answer

I found an old copy of Memberships that I had worked on once. An “instance” of the plugin is loaded via the wc_memberships() function and the restrictions class is loaded into the $this->restrictions class variable. See the main file.

In your functions.php you’d do the following to disable it.

JavaScript

Though if your content isn’t restricted (post/page settings probably… maybe a global option, I don’t remember) you don’t need to do this.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement