File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ abstract class SettingsPage extends MenuPage
42
42
* Settings API di WordPress; verrà impostato nel
43
43
* constructor automaticamente
44
44
*/
45
- private $ api ;
45
+ public $ api ;
46
46
47
47
/**
48
48
* Metodo da sovrascrivere che ritorna l'array delle sezioni
@@ -89,13 +89,12 @@ function( $cap ) {
89
89
* Callback che registra tutti i nostri settings usando l'API
90
90
*/
91
91
public function admin_init () {
92
- // Se non siamo sulla pagina dei settings, non
93
- // serve calcolare le sezioni e i campi
94
- if ( ( $ _GET [ 'page ' ] ?? '' ) !== $ this ->slug ) {
95
- return ;
96
- }
97
92
$ this ->api ->set_sections ( $ this ->getSections () );
98
- $ this ->api ->set_fields ( $ this ->getFields () );
93
+ // Se non siamo sulla pagina specifica della sezione,
94
+ // non serve calcolare tutti i campi
95
+ if ( ( $ _GET [ 'page ' ] ?? '' ) === $ this ->slug ) {
96
+ $ this ->api ->set_fields ( $ this ->getFields () );
97
+ }
99
98
$ this ->api ->admin_init ();
100
99
}
101
100
You can’t perform that action at this time.
0 commit comments