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

Konrad Karpieszuk kkarpieszuk at gmail.com
Thu Apr 14 10:17:18 UTC 2011


hello Chip

i read your tutorial (long but efficient!) and i understand that every
options from one options page i have to store in one array, yes? you
did it in this way, that option has name 'theme_oenology_options' and
every setting is array data inside this option (eg
['header_nav_menu_position'] ).

this is the only way to that? cannot i store difffrent settings in
diffrent fields in database?

i ask beacause i am prepering to change my code to fill your rules.
but if i can omit to rearrange way how data is stored will be faster
:)

On Wed, Apr 13, 2011 at 10:15 PM, Chip Bennett <chip at chipbennett.net> wrote:
> Read here:
> http://www.chipbennett.net/2011/02/17/incorporating-the-settings-api-in-wordpress-themes/
>
> If you still have questions after that, ask away!
>
> Chip
>
> On Wed, Apr 13, 2011 at 2:57 PM, Konrad Karpieszuk <kkarpieszuk at gmail.com>wrote:
>
>> hello
>>
>> i thought that i understand how to create custom settings page in new
>> way, but abviously not :)
>>
>> please look at this code:
>> http://wklej.org/id/512305/
>>
>> 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' )
>> or
>> settings_fields( array('sekcja_boksiki', 'sekcja_tabimpr') )
>>
>> but it doesnt work
>> --
>> (en) regards / (pl) pozdrawiam
>> Konrad Karpieszuk
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
(en) regards / (pl) pozdrawiam
Konrad Karpieszuk


More information about the wp-hackers mailing list