-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
38 lines (31 loc) · 924 Bytes
/
sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* The sidebar containing the main widget area
*
* @package Torro_DevHub
* @license GPL-2.0-or-later
* @link http://developer.torro-forms.com
*/
/**
* Global used to access sidebar registration data.
*
* @global array $wp_registered_sidebars Associative array of registered sidebars.
*/
global $wp_registered_sidebars;
if ( ! torro_devhub_display_sidebar() ) {
return;
}
$sidebar_slug = torro_devhub_get_sidebar_name();
if ( ! is_active_sidebar( $sidebar_slug ) ) {
return;
}
$sidebar_title = __( 'Primary Sidebar', 'torro-devhub' );
if ( isset( $wp_registered_sidebars[ $sidebar_slug ] ) ) {
$sidebar_title = $wp_registered_sidebars[ $sidebar_slug ]['name'];
}
?>
<aside id="sidebar" class="site-sidebar widget-area" aria-label="<?php echo esc_attr( $sidebar_title ); ?>">
<div class="site-sidebar-inner">
<?php dynamic_sidebar( $sidebar_slug ); ?>
</div>
</aside><!-- #sidebar -->