This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /** * Checks if the sidebar is used. * Do it by checking if there is any widget on a sidebar number. * * @param int $index Sidebar number * @return boolean True if there are widgets, false if not. */ function cham_used_sidebar($index) { $sidebars = get_option('sidebars_widgets'); $i = 'sidebar-' . $index; if (isset($sidebars[$i]) && count($sidebars[$i]) ) { return true; } else { return false; } } ?>