Title: About the code that makes conditional logic work
Last modified: March 27, 2026

---

# About the code that makes conditional logic work

 *  Resolved [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/about-the-code-that-makes-conditional-logic-work/)
 * We have updated to version 4.2.2 and migrated to the new “Widget Options Snippet”
   system.
 * However, it didn’t work when I commented out the code snippet below that allows
   the function that you previously taught me.
 *     ```wp-block-code
       function add_extra_hooks( $allowed_functions ) {$allowed_functions[] = 'in_category';return $allowed_functions;}add_filter( 'widgetopts_allowed_php_functions', 'add_extra_hooks' );
       ```
   
 * I understand that this vulnerability issue has been resolved in the latest version,
   but is it correct that the above code is still required?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/about-the-code-that-makes-conditional-logic-work/#post-18866526)
 * H i@taka1,
 * Thanks for updating to the latest version of the Widget Options plugin.
 * Since the **in_category** function is not included in the list of allowed functions
   (
   [https://widget-options.com/docs/list-of-allowed-wordpress-functions/](https://widget-options.com/docs/list-of-allowed-wordpress-functions/)),
   the filter you added in your **functions.php** file is required. Without it, 
   the code won’t be allowed or saved in the Widget Options Snippets page, and it
   will result in errors.
 * We recommend keeping this filter active to ensure the **in_category** function
   continues to work correctly with your widgets.
 * Thanks and please let us know if you have any other quesitons.
 * Kind Regards,
   Mej, Widget Options Team
 *  Thread Starter [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/about-the-code-that-makes-conditional-logic-work/#post-18866583)
 * Thank you for your confirmation.
 * It would be helpful if you could enable this feature within the plugin in the
   future.
 * Thank you for providing such a wonderful plugin.
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [2 months, 1 week ago](https://wordpress.org/support/topic/about-the-code-that-makes-conditional-logic-work/#post-18866713)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * Thanks for your suggestion! We’ll forward this to our dev team as a feature request.
 * If there’s anything else you need, please feel free to let us know.
 * Kind Regards,
   Mej, Widget Options Team

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fabout-the-code-that-makes-conditional-logic-work%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/widget-options/assets/icon-256x256.gif?rev=2513739)
 * [Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets](https://wordpress.org/plugins/widget-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-options/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-options/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mej de Castro](https://wordpress.org/support/users/mej/)
 * Last activity: [2 months, 1 week ago](https://wordpress.org/support/topic/about-the-code-that-makes-conditional-logic-work/#post-18866713)
 * Status: resolved