@@ -36,14 +36,7 @@ class Layout_Sidebar extends Base_Customizer {
36
36
*/
37
37
public function __construct () {
38
38
39
- $ this ->advanced_controls = [
40
- 'blog_archive ' => __ ( 'Blog / Archive ' , 'neve ' ),
41
- 'single_post ' => __ ( 'Single Post ' , 'neve ' ),
42
- ];
43
39
44
- $ this ->add_woocommerce_controls ();
45
-
46
- $ this ->advanced_controls ['other_pages ' ] = __ ( 'Others ' , 'neve ' );
47
40
}
48
41
49
42
/**
@@ -190,6 +183,17 @@ private function sidebar_layout_choices( $control_id ) {
190
183
return $ options ;
191
184
}
192
185
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
+ }
193
197
/**
194
198
* Advanced controls.
195
199
*/
@@ -203,8 +207,8 @@ private function add_advanced_controls() {
203
207
*
204
208
* @since 3.1.0
205
209
*/
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 ) {
208
212
$ heading_id = 'neve_ ' . $ id . '_heading ' ;
209
213
$ layout_id = 'neve_ ' . $ id . '_sidebar_layout ' ;
210
214
$ width_id = 'neve_ ' . $ id . '_content_width ' ;
0 commit comments