[wp-hackers] only one settings_section per one custom settings page?

Konrad Karpieszuk kkarpieszuk at gmail.com
Wed Apr 13 19:57:21 UTC 2011


i thought that i understand how to create custom settings page in new
way, but abviously not :)

please look at this code:

this code creates custom settings page named 'Ustawienia Biebrza.com'
and add to it two sections:
- sekcja_boksiki (line 19.)
- sekcja_tabimpr (line 34.)

everything looks great (please check:
http://awesomescreenshot.com/00bbbhbde ) but it doesnt work :)

when i want to update smth in (lower) section sekcja_tabimpr it is
updated. but if i change smth in (upper) section sekcja_boksiki,
nothing is changed

i thing this is a problem with lines 76-77:
<?php settings_fields( 'sekcja_boksiki' ); ?>
<?php settings_fields( 'sekcja_tabimpr' ); ?>

those lines creates hidden form fields for those sections. but fields
pritned by second line overwite some values from fields printed by
first setting_fields

how to add two sections to one page?

i tried to replace problematic lines with:
settings_fields( 'sekcja_boksiki', 'sekcja_tabimpr' )
settings_fields( array('sekcja_boksiki', 'sekcja_tabimpr') )

but it doesnt work
(en) regards / (pl) pozdrawiam
Konrad Karpieszuk

More information about the wp-hackers mailing list