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
4242 * Settings API di WordPress; verrà impostato nel
4343 * constructor automaticamente
4444 */
45- private $ api ;
45+ public $ api ;
4646
4747 /**
4848 * Metodo da sovrascrivere che ritorna l'array delle sezioni
@@ -89,13 +89,12 @@ function( $cap ) {
8989 * Callback che registra tutti i nostri settings usando l'API
9090 */
9191 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- }
9792 $ 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+ }
9998 $ this ->api ->admin_init ();
10099 }
101100
You can’t perform that action at this time.
0 commit comments