Output ‘do_settings_sections()’ as tabs, not one under the other

So because I couldn’t find an out of the box way, I created this. Don’t forget to enqueue the jquery-ui-tabs script – /** Replace the call to ‘do_settings_sections()’ with a call to this function */ function do_settings_sections_tabs($page){ global $wp_settings_sections, $wp_settings_fields; if(!isset($wp_settings_sections[$page])) : return; endif; echo ‘<div id=”abb-tabs”>’; echo ‘<ul>’; foreach((array)$wp_settings_sections[$page] as $section) : if(!isset($section[‘title’])) continue; … Read more

Settings Page won’t save

For anyone else that may not have read the above comments and are having a possibly similar issue, @epilektric has answered the question stating that the = sign was missing after the value attribute under the field_1 and field_2 functions.

wordpress settings API and option array structure

The Settings API generally expects data in the key => value form. I’m sure it is possible to save array data using the Settings API, but it somewhat circumvents the purpose of the API. If I’m understanding your question correctly, you’re trying to take a Plugin Option, and use the value of that option to … Read more

Persist fields with Setting API

This a really good question – my suggestion is to use transients. For instance, in your validation callback: wpse51669_validation_cb($settings){ //Perform validation checks if( $valid ){ //If settings validate return $validate_settings; } //Otherwise add settings error add_settings_error(‘my-plug-in-settings’,’error-with-xyz’, ‘I fell over’,’error’); //And add the failed settings to a transient set_transient( ‘my-plug-in-settings-invalid’, $settings, 60); return false; } Then … Read more