Title: Conditional logic doesn&#8217;t work
Last modified: September 9, 2025

---

# Conditional logic doesn’t work

 *  Resolved [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [9 months ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/)
 * Hello,
 * I updated the Widget Options to the latest version 4.1.2 in WordPress version
   6.8.2, and conditional logic no longer appears.
   Roll back to 4.1.1 and it works
   fine.We would like you to proceed with an investigation into this matter.
 * Best regards,

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

 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [9 months ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18634521)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * Thank you for reaching out to us. Could you please let us know how the Conditional
   Logic does not appear on your end after updating Widget Options to version 4.1.2?
   Please also include which roles the Conditional Logic is not appearing for. Screenshots
   are highly appreciated too!
 * We’ll be glad to check this further once we have the details.
 * Kind Regards,
   Mej, Widget Options Team
 *  Thread Starter [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [9 months ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18635920)
 * Hi [@mej](https://wordpress.org/support/users/mej/),
 * Since this is a test environment in Japanese, we will send you a screenshot translated
   into English.
 * Below is the widget settings screen. The sidebar is only visible in certain categories.
 * ![](https://i0.wp.com/iserp.xsrv.jp/wp-content/uploads/2025/09/Setting-the-Conditional-
   Logic-Menu-scaled.png)
 * Widget Options Version 4.1.1 shows the sidebar with widget options.
 * ![](https://i0.wp.com/iserp.xsrv.jp/wp-content/uploads/2025/09/widget-Options-
   ver-4.1.1-scaled.png)
 * Widget Options Version 4.1.2 does not display the sidebar with widget options.
 * ![](https://i0.wp.com/iserp.xsrv.jp/wp-content/uploads/2025/09/widget-Options-
   ver-4.1.2-scaled.png)
 * I have used the rollback plugin many times to see the difference in display due
   to version changes, but it doesn’t show well in 4.1.2. Additionally, there are
   no changes or updates other than the widget options.
 * thank you
    -  This reply was modified 9 months ago by [taka1](https://wordpress.org/support/users/taka1/).
    -  This reply was modified 9 months ago by [taka1](https://wordpress.org/support/users/taka1/).
    -  This reply was modified 9 months ago by [taka1](https://wordpress.org/support/users/taka1/).
 *  Thread Starter [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [8 months, 4 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18636810)
 * Hi [@mej](https://wordpress.org/support/users/mej/),
 * Due to basic authentication, no screenshots were displayed, so we will post images.
 * > [View post on imgur.com](https://imgur.com/a/j6SJLUG)
 * > [View post on imgur.com](https://imgur.com/a/DNHJTjy)
 * > [View post on imgur.com](https://imgur.com/a/aElBlwE)
 * thank you
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [8 months, 4 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18637710)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * We will take our time to review this carefully and coordinate with our dev team
   for further action. Rest assured, we’ll keep you posted with any updates.
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18641506)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * Thanks for the screenshots. We have reviewed these issues, and the code execution
   functionality was flagged as potentially dangerous, so we decided to restrict
   the display logic feature to administrators only. This might cause the logic 
   codes to be affected by the recent update.
 * If you are the website administrator and your conditional logic code is no longer
   working, we highly recommend updating the code or adjusting the conditions to
   ensure compatibility with the latest version.
 * Please let us know if you need further guidance. We’ll be glad to help.
 * Kind Regards,
   Mej, Widget Options Team
 *  Thread Starter [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18643096)
 * Hi [@mej](https://wordpress.org/support/users/mej/),
 * Please explain in detail about updating your code or adjusting your terms to 
   ensure compatibility with the latest versions.
 * For example, how should I modify the following conditional logic?
 * `in_category(array(‘example1,’example2’,’example3’))`
 * `is_single( array( 1 , 2 ))`
 * thank you.
    -  This reply was modified 8 months, 3 weeks ago by [taka1](https://wordpress.org/support/users/taka1/).
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18644728)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * We’ve relayed this to our dev team to request a detailed explanation. Once we
   receive their feedback, we’ll keep you updated right away.
 * We truly appreciate your patience in the meantime!
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18646378)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * We’ve received feedback from our developers regarding this issue. In the latest
   version of Widget Options, some of the display logic functions were removed due
   to vulnerability reports that might pose risks to users.
 * Based on the logic code you’re using, the function `in_category` is not currently
   included in the list of allowed functions. To review the functions that are permitted
   by default, you may check `includes/extras.php` and look for `widgetopts_get_allowed_php_functions`
   and `widgetopts_get_allowed_wp_functions`.
 * If you’d like to enable `in_category`, you will need to extend the allowed functions
   list by adding a filter. Please note that adding custom functions may introduce
   security risks, so we recommend proceeding with caution.
 * Here’s the code snippet you can add to your `functions.php` file (or another 
   suitable location in your theme/plugin):
 * `function add_extra_hooks( $allowed_functions ) {
   $allowed_functions[] = 'in_category';
   return $allowed_functions;}add_filter( 'widgetopts_allowed_php_functions', 'add_extra_hooks');
 * This should allow the `in_category` function to work again on your site. Please
   feel free to modify the code based on your current setup.
 * Thanks and let us know if this works on your end.
 * Kind Regards,
   Mej, Widget Options Team
 *  Thread Starter [taka1](https://wordpress.org/support/users/taka1/)
 * (@taka1)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18646693)
 * Hi @mej,
 * We have confirmed that the code in `functions.php` you provided has worked.
 * It’s an essential plugin for me.
 * We would like to express our sincere gratitude.
 * thank you.
    -  This reply was modified 8 months, 3 weeks ago by [taka1](https://wordpress.org/support/users/taka1/).
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18648129)
 * Hi [@taka1](https://wordpress.org/support/users/taka1/),
 * Thanks for the update! We’re glad to hear that the issue is now resolved on your
   website. Please note that these filters are required for your conditional logic
   to work as expected. We recommend checking your functions.php file after theme
   updates to ensure the filters are not overwritten.
 * If you run into any other issues or have further questions, please don’t hesitate
   to reach out. We’re here to help!
 * Kind Regards,
   Mej, Widget Options Team

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

The topic ‘Conditional logic doesn’t work’ is closed to new replies.

 * ![](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/)

 * 11 replies
 * 2 participants
 * Last reply from: [Mej de Castro](https://wordpress.org/support/users/mej/)
 * Last activity: [8 months, 3 weeks ago](https://wordpress.org/support/topic/conditional-logic-doesnt-work-6/#post-18648129)
 * Status: resolved