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

Chip Bennett chip at chipbennett.net
Wed Apr 13 20:15:19 UTC 2011


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
>


More information about the wp-hackers mailing list