Theme-Options.php doesn't save content – only sometimes
-
Hi π
we run a multisite installation on WP 3.0.2, or better we wan’t to go in production in a few days. We coded our own theme, plugins etc, everything worked great.
But now all of a sudden, the theme-options.php decided to not save content anymore, but only sometimes… And we are puzzled as to why this is happening.
We have options in there that are supposed to add some extra css, xhtml to the footer and slogans to pages. So nothing really special, and it worked great until yesterday.
We disabled the plugin we initially thought could cause problems, but that didn’t solve it.
So I decided to ask here for help, maybe you guys have an idea what could cause something like this, and point us in the right direction?
Here’s a copy of our theme-options.php, maybe we do something fundamentally wrong in there but I doubt it π
<?php // on admin init create the theme options add_action ( 'admin_init', 'init_theme_options'); // add admin menu option add_action ( 'admin_menu', 'init_options_menu'); /** *@method null init_theme_options() register the options settings **/ function init_theme_options() { // register option settings register_setting ( 'ourcustom_theme_options_group', 'ourcustom_theme_options' ); } /** *@method null init_options_menu() create the admin menu item for theme options **/ function init_options_menu() { add_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', 'theme-options', 'theme_options_page' ); } /** *@method null theme_options_page() crete the admin theme options page **/ function theme_options_page() { //get updated request if ( !isset( $_REQUEST['updated'] ) ) $_REQUEST['updated'] = false; ?> <div class="wrap"> <h2>Theme Options</h2> <?php if ( $_REQUEST['updated'] == true ): ?> <div class="updated">Your Options Have Been Saved</div> <?php endif; ?> <form action="options.php" method="post"> <?php // display required options form fields settings_fields( 'ourcustom_theme_options_group' ); //get our options $options = get_option ( 'ourcustom_theme_options'); ?> <h3>Default Theme Header Slogan</h3> <input type="text" name="ourcustom_theme_options[header_slogan]" style="width:100%;" value="<?= $options['header_slogan']; ?>" /> <h3>Per Page Theme Header Slogans</h3> <div style="margin-bottom: 10px; border:1px solid #DFDFDF; padding: 2px; height: 300px; overflow-y:scroll; overflow-x: hidden;"> <?php //get pages $pages = get_pages(); if ( !empty ( $pages ) ) { foreach ( $pages as $page ) { ?><p><?= $page->post_title; ?><br /><input type="text" name="ourcustom_theme_options[page_header_slogans][<?= $page->ID; ?>]" style="width: 95%;" value="<?= $options['page_header_slogans'][$page->ID]; ?>" /></p><?php } } ?> </div> <h3>XHTML For Footer Menu - Only Displays To Logged Out Users</h3> <textarea name="ourcustom_theme_options[footer_nav_xhtml]" style="width:100%; height: 100px;"><?= $options['footer_nav_xhtml']; ?></textarea> <h3>XHTML For Bottom Bar</h3> <textarea name="ourcustom_theme_options[bottom_bar_xhtml]" style="width:100%; height:100px;"><?= $options['bottom_bar_xhtml']; ?></textarea> <h3>Extra CSS To Add To Page Header</h3> <textarea name="ourcustom_theme_options[theme_extra_css]" style="width: 100%; height:100px;"><?= $options['theme_extra_css']; ?></textarea> <p><input type="submit" value="Save Options" /></p> </form> </div> <?php } ?>
The topic ‘Theme-Options.php doesn't save content – only sometimes’ is closed to new replies.