/** * Registers sidebars. * * @since 1.0 * @access public * @return void */ function hoot_base_register_sidebars() { hoot_register_sidebar(array('id' => 'primary-sidebar', 'name' => _x('Primary Sidebar', 'sidebar', 'hoot'), 'description' => __('The main sidebar throughout the site.', 'hoot'))); hoot_register_sidebar(array('id' => 'topbar-left', 'name' => _x('Topbar Left', 'sidebar', 'hoot'), 'description' => __('Leave empty if you dont want to show topbar.', 'hoot'))); hoot_register_sidebar(array('id' => 'topbar-right', 'name' => _x('Topbar Right', 'sidebar', 'hoot'), 'description' => __('Leave empty if you dont want to show topbar.', 'hoot'))); hoot_register_sidebar(array('id' => 'sub-footer', 'name' => _x('Sub Footer', 'sidebar', 'hoot'), 'description' => __('Leave empty if you dont want to show subfooter.', 'hoot'))); }
/** * Registers footer widget areas. * * @since 1.0.0 * @access public * @return void */ function hoot_widgetized_template_register_sidebars() { if (current_theme_supports('hoot-widgetized-template')) { /* Set up some default widget areas. */ $defaults = array('area_a' => __('Widgetized Template - Area A', 'responsive-brix'), 'area_b' => __('Widgetized Template - Area B', 'responsive-brix'), 'area_c' => __('Widgetized Template - Area C', 'responsive-brix'), 'area_d_1' => __('Widgetized Template - Area D Left', 'responsive-brix'), 'area_d_2' => __('Widgetized Template - Area D Right', 'responsive-brix')); /* Allow changing widget areas by the theme. */ $defaults = apply_filters('hoot_widgetized_template_widget_areas', $defaults); foreach ($defaults as $key => $name) { hoot_register_sidebar(array('id' => 'widgetized-template-' . $key, 'name' => $name, 'description' => __('You can order Widgetized Template areas in Theme Options page.', 'responsive-brix'))); } } }
/** * Registers woocommerce sidebars. * * @since 1.8 * @access public * @return void */ function hoot_woo_register_sidebars() { hoot_register_sidebar(array('id' => 'woocommerce-sidebar', 'name' => _x('Woocommerce Sidebar', 'sidebar', 'responsive-brix'), 'description' => __('The primary sidebar for woocommerce pages', 'responsive-brix'))); }
/** * Registers widgetized template widget areas. * * @since 1.0.0 * @access public * @return void */ function hoot_widgetized_template_register_sidebars() { if (current_theme_supports('hoot-widgetized-template')) { $areas = array(); /* Set up defaults */ $defaults = apply_filters('hoot_widgetized_template_widget_areas', array('a', 'b', 'c', 'd', 'e')); $locations = array(__('Left', 'responsive-brix'), __('Center Left', 'responsive-brix'), __('Center', 'responsive-brix'), __('Center Right', 'responsive-brix'), __('Right', 'responsive-brix')); // Get user settings $sections = hoot_sortlist(hoot_get_mod('widgetized_template_sections')); foreach ($defaults as $key) { $id = "area_{$key}"; if (empty($sections[$id]['sortitem_hide'])) { $columns = isset($sections[$id]['columns']) ? $sections[$id]['columns'] : ''; $count = count(explode('-', $columns)); // empty $columns still returns array of length 1 $location = ''; for ($c = 1; $c <= $count; $c++) { switch ($count) { case 2: $location = $c == 1 ? $locations[0] : $locations[4]; break; case 3: $location = $c == 1 ? $locations[0] : ($c == 2 ? $locations[2] : $locations[4]); break; case 4: $location = $c == 1 ? $locations[0] : ($c == 2 ? $locations[1] : ($c == 3 ? $locations[3] : $locations[4])); } $areas[$id . '_' . $c] = sprintf(__('Widgetized Template - Area %s %s', 'responsive-brix'), strtoupper($key), $location); } } } foreach ($areas as $key => $name) { hoot_register_sidebar(array('id' => 'widgetized-template-' . $key, 'name' => $name, 'description' => __("You can order Widgetized Template areas in Customizer > 'Templates' panel > 'Widgetized Template' section.", 'responsive-brix'))); } } }
/** * Registers woocommerce sidebars. * * @since 1.5 * @access public * @return void */ function hoot_woo_register_sidebars() { hoot_register_sidebar(array('id' => 'woocommerce-sidebar', 'name' => _x('Woocommerce Sidebar', 'sidebar', 'dispatch'), 'description' => __('The main sidebar for woocommerce pages', 'dispatch'))); }