| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/themes/glaza/includes/ |
Upload File : |
<?php
//add action
add_action( 'redux/options/glaza_theme_options/saved', 'glaza_sidebar_add_data' );
add_action( 'redux/options/glaza_theme_options/reset', 'glaza_sidebar_add_data' );
add_action( 'redux/options/glaza_theme_options/section/reset', 'glaza_sidebar_add_data' );
add_action( 'widgets_init', 'glaza_register_all_sidebars' );
/**
* @return bool
* sidebar data
*/
if ( ! function_exists( 'glaza_sidebar_add_data' ) ) {
function glaza_sidebar_add_data() {
global $glaza_theme_options;
$data_sidebar = array();
if ( ! empty( $glaza_theme_options['glaza_multi_sidebar'] ) && is_array( $glaza_theme_options['glaza_multi_sidebar'] ) ) {
foreach ( $glaza_theme_options['glaza_multi_sidebar'] as $sidebar ) {
array_push( $data_sidebar, array(
'id' => 'glaza_sidebar_multi_' . glaza_name_to_id( trim( $sidebar ) ),
'name' => strip_tags( $sidebar ),
) );
}
}
delete_option( 'glaza_data_sidebars' );
add_option( 'glaza_data_sidebars', $data_sidebar );
}
}
/**
* register sidebars
*/
if ( ! function_exists( 'glaza_register_all_sidebars' ) ) {
function glaza_register_all_sidebars() {
$data_sidebar = get_option( 'glaza_data_sidebars', null );
if ( ! empty( $data_sidebar ) && is_array( $data_sidebar ) ) {
foreach ( $data_sidebar as $sidebar ) {
register_sidebar( array(
'id' => $sidebar['id'],
'name' => $sidebar['name'],
'description' => esc_html__( 'A sidebar section of your website.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
};
};
register_sidebar( array(
'id' => 'glaza_sidebar_default',
'name' => esc_html__( 'Default Sidebar', 'glaza' ),
'description' => esc_html__( 'The default sidebar of the this theme.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_topsite',
'name' => esc_html__( 'Header - Top Full Width Section', 'glaza' ),
'description' => esc_html__( 'Full-width section at the top of your website.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget topsite-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_offcanvas',
'name' => esc_html__( 'Off-Canvas Section', 'glaza' ),
'description' => esc_html__( 'The hidden section at the left of your website. This section contains mobile navigation and widgets for displaying mobile devices.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
//single section
register_sidebar( array(
'id' => 'glaza_sidebar_single_top',
'name' => esc_html__( 'Single - Top Section', 'glaza' ),
'description' => esc_html__( 'The Top Section of single post content.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_single_bottom',
'name' => esc_html__( 'Single - Bottom Section', 'glaza' ),
'description' => esc_html__( 'The Bottom Section of single post content. Allow you can put Ad or Subscribe box', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_fw_footer',
'name' => esc_html__( 'Footer - Top Full Width Section', 'glaza' ),
'description' => esc_html__( 'The Full-width section at the top of the footer area.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_footer_1',
'name' => esc_html__( 'Footer - Column 1', 'glaza' ),
'description' => esc_html__( 'one of the columns of the footer area.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_footer_2',
'name' => esc_html__( 'Footer - Column 2', 'glaza' ),
'description' => esc_html__( 'one of the columns of the footer area.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
register_sidebar( array(
'id' => 'glaza_sidebar_footer_3',
'name' => esc_html__( 'Footer - Column 3', 'glaza' ),
'description' => esc_html__( 'one of the columns of the footer area.', 'glaza' ),
'before_widget' => '<div id="%1$s" class="widget widget-sidebar %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
}
}