$tag ) {
if ( get_queried_object_id() === (int) $tags_data[ $key ]['id'] ) {
$tags_data[ $key ]['class'] = $tags_data[ $key ]['class'] . ' current-item';
}
}
}
return apply_filters( 'astra_filter_widget_tag_cloud', $tags_data );
}
add_filter( 'wp_generate_tag_cloud_data', 'astra_filter_widget_tag_cloud' );
endif;
/**
* Register widget area.
*/
if ( ! function_exists( 'astra_widgets_init' ) ) :
/**
* Register widget area.
*
* @see https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function astra_widgets_init() {
/**
* Register Main Sidebar
*/
register_sidebar(
apply_filters(
'astra_widgets_init',
array(
'name' => esc_html__( 'Main Sidebar', 'astra' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
)
)
);
/**
* Register Header Widgets area
*/
register_sidebar(
apply_filters(
'astra_header_widgets_init',
array(
'name' => esc_html__( 'Header', 'astra' ),
'id' => 'header-widget',
'description' => '',
'before_widget' => '',
'before_title' => '',
)
)
);
/**
* Register Footer Bar Widgets area
*/
register_sidebar(
apply_filters(
'astra_footer_1_widgets_init',
array(
'name' => esc_html__( 'Footer Bar Section 1', 'astra' ),
'id' => 'footer-widget-1',
'description' => '',
'before_widget' => '',
'before_title' => '',
)
)
);
register_sidebar(
apply_filters(
'astra_footer_2_widgets_init',
array(
'name' => esc_html__( 'Footer Bar Section 2', 'astra' ),
'id' => 'footer-widget-2',
'description' => '',
'before_widget' => '',
'before_title' => '',
)
)
);
/**
* Register Footer Widgets area
*/
register_sidebar(
apply_filters(
'astra_advanced_footer_widget_1_args',
array(
'name' => esc_html__( 'Footer Widget Area 1', 'astra' ),
'id' => 'advanced-footer-widget-1',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
)
);
register_sidebar(
apply_filters(
'astra_advanced_footer_widget_2_args',
array(
'name' => esc_html__( 'Footer Widget Area 2', 'astra' ),
'id' => 'advanced-footer-widget-2',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
)
);
register_sidebar(
apply_filters(
'astra_advanced_footer_widget_3_args',
array(
'name' => esc_html__( 'Footer Widget Area 3', 'astra' ),
'id' => 'advanced-footer-widget-3',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
)
);
register_sidebar(
apply_filters(
'astra_advanced_footer_widget_4_args',
array(
'name' => esc_html__( 'Footer Widget Area 4', 'astra' ),
'id' => 'advanced-footer-widget-4',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
)
)
);
}
add_action( 'widgets_init', 'astra_widgets_init' );
endif;