michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
339 stars 71 forks source link

Non-section Field #179

Closed baskettcase closed 9 years ago

baskettcase commented 9 years ago

I have several sections within a settings page, but I would like to have one field at the bottom of the page that is outside the sections. I tried just removing the section_id from the addSettingFields() method, but that just put the field within the previous section. How can I escape the section?

baskettcase commented 9 years ago

Ok I figured out that if I used the section_id '_default', that would show it outside the sections. It pops it up to the top of the page though. So the next question is how do I keep it at the bottom of the form? I tried "order", but that didn't work.

michaeluno commented 9 years ago

To move the default section to the bottom, you may try inserting this after the last call of $this->addSettingSections().

$this->oForm->aSections['_default']['order'] = 999; // or set the largest section order
baskettcase commented 9 years ago

Awesome, thank you, that worked beautifully! No way I would have figured that one out.

michaeluno commented 9 years ago

Glad it helped!