Title: New theme compatibility function
Last modified: August 22, 2016

---

# New theme compatibility function

 *  Resolved [Dexter0015](https://wordpress.org/support/users/improvedline/)
 * (@improvedline)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/)
 * Hi,
 * I needed a way to know if the sidebar/corral have any widgets in order to add
   specials classes in my theme and I didn’t find any method to do it in the plugin
   files, so I made my own :
 * I added it in the “backwards-compat-functions.inc” file :
 *     ```
       /**
        * Check if sidebar/corral cotaint widgets or not
        */
       function ww_is_active_sidebar($corral_slug) {
           global $widget_wrangler;
           if(count($widget_wrangler->page_widgets[$corral_slug]) > 0) {
               return true;
           }
           else {
               return false;
           }
       }
       ```
   
 * So you just need to call it in your theme like so :
    `ww_is_active_sidebar('your-
   corral-slug');`
 * Where ‘your-corral-slug’ should be replace by the corral you need to check.
 * Hope it help.
 * [https://wordpress.org/plugins/widget-wrangler/](https://wordpress.org/plugins/widget-wrangler/)

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

 *  Plugin Author [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/#post-5488210)
 * Hi improvedline,
 * This looks good! Seems like it could be a very useful concept, and I will include
   it in the next release.
 * One thing, the function name `ww_is_active_sidebar` should be `ww_is_active_corral`.
   I’m not a fan of the word ‘sidebar’ at all, because it’s not fully representative
   of its use. In WW 2.x+ I use “sidebar” to mean WordPress’s implementation of 
   a group of widgets, and “corral” to mean Widget Wrangler’s implementation of 
   a group of widgets. Since this deals with WW’s implementation (checking to see
   if widgets exist in a corral on this page), we should use the word corral.
 * I’ll include this in the next release with the function name `ww_is_active_corral`,
   so if you change your implementation, you’ll be next-release-ready!
 * Let me know what you think,
    Jonathan
 *  Thread Starter [Dexter0015](https://wordpress.org/support/users/improvedline/)
 * (@improvedline)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/#post-5488226)
 * Hi Jonathan,
 * You’re right, and I already change my implementation in my WIP project.
 * I’m glad you like it.
 *  Plugin Author [Jonathan Daggerhart](https://wordpress.org/support/users/daggerhart/)
 * (@daggerhart)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/#post-5488446)
 * Hi improvedline,
 * This is included in the most recent version 2.1.4 – [https://plugins.trac.wordpress.org/browser/widget-wrangler/trunk/common/backwards-compat-functions.inc?rev=1036724#L24](https://plugins.trac.wordpress.org/browser/widget-wrangler/trunk/common/backwards-compat-functions.inc?rev=1036724#L24)
 * Let me know if you run into any issues with this.
 * Thanks,
    Jonathan
 *  Thread Starter [Dexter0015](https://wordpress.org/support/users/improvedline/)
 * (@improvedline)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/#post-5488448)
 * Hi Jonathan,
 * I already updated two sites and didn’t notice any problem (both on WP 4.0.1).

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

The topic ‘New theme compatibility function’ is closed to new replies.

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

## Tags

 * [new function](https://wordpress.org/support/topic-tag/new-function/)
 * [theme compatibility](https://wordpress.org/support/topic-tag/theme-compatibility/)

 * 4 replies
 * 2 participants
 * Last reply from: [Dexter0015](https://wordpress.org/support/users/improvedline/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/new-theme-compatibility-function/#post-5488448)
 * Status: resolved