function enlightenment_sidebar_locations() { $sidebars = apply_filters('enlightenment_sidebar_locations', array('primary' => array('name' => __('Primary Sidebar', 'enlightenment'), 'contained' => true, 'sidebar' => 'sidebar-1'))); $locations = array(); foreach (enlightenment_unlimited_sidebars_templates() as $template => $name) { $locations[$template] = $sidebars; } return apply_filters('enlightenment_sidebar_locations_options', $locations); }
function enlightenment_unlimited_sidebars_current_template() { global $pagenow; if ('post.php' == $pagenow && isset($_GET['action']) && 'edit' == $_GET['action']) { $template = get_post_type(); } elseif (isset($_GET['template'])) { $template = esc_attr($_GET['template']); } else { $templates = enlightenment_unlimited_sidebars_templates(); reset($templates); $template = key($templates); } return $template; }