includes/class-custom-sidebars.php
public function sidebars_widgets( $sidebar_widgets ) {

		if ( ! is_admin() && ! empty( $this->get_sidebar() ) ) {
			foreach ( $sidebar_widgets as $key => $widgets ) {
				$sidebar_widgets[ $key ] = $sidebar_widgets[ $this->get_sidebar() ];
			}
		}

		return $sidebar_widgets;

	}
public function sidebars_widgets( $sidebar_widgets ) {

		if ( ! is_admin() && ! empty( $this->get_sidebar() ) ) {
			foreach ( $sidebar_widgets as $key => $widgets ) {
				$sidebar_widgets[ $key ] = $sidebar_widgets[ $this->get_sidebar() ];
			}
		}

		return $sidebar_widgets;

	}
public function sidebars_widgets ( $ sidebar_widgets ) { if ( ! is_admin ( ) && ! empty ( $ this -> get_sidebar ( ) ) ) { foreach ( $ sidebar_widgets as $ key => $ widgets ) { $ sidebar_widgets [ $ key ] = $ sidebar_widgets [ $ this -> get_sidebar ( ) ] ; } } return $ sidebar_widgets ; }
Filter the sidebar widgets

This method is hooked to the WP filter sidebars_widgets.

Since we have no way to know what sidebar is currently being called, this method
replaces the array of widgets for ALL registered sidebars with the widgets
assigned to the sidebar specified for use on this particular post/page. This is a
carpet-bomb approach that should be more specific, but current limitiations in the
WP infrastructure require it to be done this way.

@param  array $sidebar_widgets
@return array $sidebar_widgets The filtered widget array
@since  0.3
Filter the sidebar widgets