Title: Check if function exists before processing Widgets
Last modified: August 22, 2016

---

# Check if function exists before processing Widgets

 *  Resolved [Sergio De Falco](https://wordpress.org/support/users/sgr33n/)
 * (@sgr33n)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/check-if-function-exists-before-processing-widgets/)
 * Hi,
 * I would ask if it’s possible to make a check on the declared widget conditional
   tags.
 * Suppose you have BuddyPress Installed and want to show widgets only when the 
   displayed page is a BuddyPress one. We can use is_buddypress(). But if for maintenance
   we disable BuddyPress Plugin, than widget logics returns error:
 *     ```
       Call to undefined function is_buddypress() in /var/www/www.example.com/httpdocs/wp-content/plugins/widget-logic/widget_logic.php(286) : eval()'d code on line 1
       ```
   
 * This could be easly avoid with the use of function_exists( $conditional_function)
   check.
 * Thanks 🙂
 * [https://wordpress.org/plugins/widget-logic/](https://wordpress.org/plugins/widget-logic/)

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

 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/check-if-function-exists-before-processing-widgets/#post-5301749)
 * that would be hard to parse in the plugin, but you could add it to your own WL
   code
 * `function_exists("is_buddypress") && is_buddypress()`
 * with an ‘&&’ if the first operand is FALSE, the 2nd isn’t evaluated, so you won’t
   get stung
 *  Thread Starter [Sergio De Falco](https://wordpress.org/support/users/sgr33n/)
 * (@sgr33n)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/check-if-function-exists-before-processing-widgets/#post-5301751)
 * Can this be done? really good! so this could be the solution 🙂
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/check-if-function-exists-before-processing-widgets/#post-5301752)
 * 😉

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

The topic ‘Check if function exists before processing Widgets’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/check-if-function-exists-before-processing-widgets/#post-5301752)
 * Status: resolved