Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
mega footer fix
Browse files Browse the repository at this point in the history
Fixed problem of function retrieving widgets in mega footer
  • Loading branch information
szk11001 committed Jul 9, 2014
1 parent f62c2e4 commit 9199bf6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions inc/reg-sidebars.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
}

// if no title then add widget content wrapper to before widget
add_filter( 'dynamic_sidebar_params', 'check_sidebar_params' );
function check_sidebar_params( $params ) {
global $wp_registered_widgets;

$settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ]['callback'][0];
$settings = $settings_getter->get_settings();
$settings = $settings[ $params[1]['number'] ];
Expand All @@ -56,11 +55,8 @@ function check_sidebar_params( $params ) {

#Counts widgets in mega footer and adds column class accordingly
if( $params[0]['id'] == 'mega-footer' ){
if( is_multisite() ){
$widgets = get_site_option('sidebars_widgets')['mega-footer'];
} else {
$widgets = get_option('sidebars_widgets')['mega-footer'];
}
$sidebars = get_option('sidebars_widgets');
$widgets = $sidebars['mega-footer'];
$count = count($widgets);
if( $count > 6 ){
$cols = 2;
Expand All @@ -71,6 +67,7 @@ function check_sidebar_params( $params ) {
}
return $params;
}
add_filter( 'dynamic_sidebar_params', 'check_sidebar_params' );

function mf_remove_extra( $sidebars_widgets ){
$widgets = $sidebars_widgets['mega-footer'];
Expand Down

0 comments on commit 9199bf6

Please sign in to comment.