@@ -36,14 +36,7 @@ class Layout_Sidebar extends Base_Customizer {
3636 */
3737 public function __construct () {
3838
39- $ this ->advanced_controls = [
40- 'blog_archive ' => __ ( 'Blog / Archive ' , 'neve ' ),
41- 'single_post ' => __ ( 'Single Post ' , 'neve ' ),
42- ];
4339
44- $ this ->add_woocommerce_controls ();
45-
46- $ this ->advanced_controls ['other_pages ' ] = __ ( 'Others ' , 'neve ' );
4740 }
4841
4942 /**
@@ -190,6 +183,17 @@ private function sidebar_layout_choices( $control_id ) {
190183 return $ options ;
191184 }
192185
186+ public function get_advanced_controls () {
187+ if ( empty ( $ this ->advanced_controls ) ) {
188+ $ this ->advanced_controls = [
189+ 'blog_archive ' => __ ( 'Blog / Archive ' , 'neve ' ),
190+ 'single_post ' => __ ( 'Single Post ' , 'neve ' ),
191+ ];
192+ $ this ->add_woocommerce_controls ();
193+ $ this ->advanced_controls ['other_pages ' ] = __ ( 'Others ' , 'neve ' );
194+ }
195+ return $ this ->advanced_controls ;
196+ }
193197 /**
194198 * Advanced controls.
195199 */
@@ -203,8 +207,8 @@ private function add_advanced_controls() {
203207 *
204208 * @since 3.1.0
205209 */
206- $ this -> advanced_controls = apply_filters ( 'neve_sidebar_controls_filter ' , $ this ->advanced_controls );
207- foreach ( $ this -> advanced_controls as $ id => $ heading_label ) {
210+ $ advanced_controls = apply_filters ( 'neve_sidebar_controls_filter ' , $ this ->get_advanced_controls () );
211+ foreach ( $ advanced_controls as $ id => $ heading_label ) {
208212 $ heading_id = 'neve_ ' . $ id . '_heading ' ;
209213 $ layout_id = 'neve_ ' . $ id . '_sidebar_layout ' ;
210214 $ width_id = 'neve_ ' . $ id . '_content_width ' ;
0 commit comments