Merge pull request #325 from blowsie/patch-1 - Good idea! Seems I just forget it to add. Thx @blowsie !
Allow slbd_count_widgets function to be overridden
This commit is contained in:
commit
ff71842e73
|
@ -9,7 +9,8 @@
|
||||||
* Count number of widgets in a sidebar
|
* Count number of widgets in a sidebar
|
||||||
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row
|
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row
|
||||||
*/
|
*/
|
||||||
function slbd_count_widgets( $sidebar_id ) {
|
if ( ! function_exists( 'slbd_count_widgets' ) ) {
|
||||||
|
function slbd_count_widgets( $sidebar_id ) {
|
||||||
// If loading from front page, consult $_wp_sidebars_widgets rather than options
|
// If loading from front page, consult $_wp_sidebars_widgets rather than options
|
||||||
// to see if wp_convert_widget_settings() has made manipulations in memory.
|
// to see if wp_convert_widget_settings() has made manipulations in memory.
|
||||||
global $_wp_sidebars_widgets;
|
global $_wp_sidebars_widgets;
|
||||||
|
@ -40,9 +41,9 @@ function slbd_count_widgets( $sidebar_id ) {
|
||||||
endif;
|
endif;
|
||||||
return $widget_classes;
|
return $widget_classes;
|
||||||
endif;
|
endif;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( ! function_exists( 'understrap_widgets_init' ) ) {
|
if ( ! function_exists( 'understrap_widgets_init' ) ) {
|
||||||
/**
|
/**
|
||||||
* Initializes themes widgets.
|
* Initializes themes widgets.
|
||||||
|
|
Reference in New Issue