What does this code do?
-
Hi,
This is the code from WooCommerce documentation: (https://docs.woocommerce.com/document/create-a-plugin/)
/** * Check if WooCommerce is active **/ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { // Put your plugin code here }
I understand what this code does, but I can not understand why call to apply_filters(…) is required? Just using get_option( ‘active_plugins’ ) and then looking through it seem enough.
Thanks,
Rudolf
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘What does this code do?’ is closed to new replies.