What is wrong with this?
-
I have this code that I put in the functions.php file and it works as far as giving me the menu under settings and adding the content to the database. I can display the content on the site. The problem is that anytime I click on the store button (Submit button) the screen goes blank and I have to use the back button to get back to the wordpress screen. This also affects everything in the settings menu so any time I make a change in the settings menu, the screen goes blank and I to use the back button to get back to the wordpress screen. The settings are saved to the database. If I take this new code out, everything works. Am I missing something in this code?
<?php
add_action(‘admin_menu’, ‘add_important_news_options’);
function add_important_news_options()
{
add_options_page(‘Important News Options’, ‘Important News Options’, ‘manage_options’, ‘functions’,’important_news_options’);
} ?>
<?php
function important_news_options()
{?>
<div class=”wrap”>
<h2>Important News Options</h2>
<form method=”post” action=”options.php”>
<?php wp_nonce_field(‘update-options’) ?>
<p>Important News:
<input type=”text” name=”ImportNewsid” size=”80″ value=”<?php echo get_option(‘ImportNewsid’); ?>” />
</p>
<input type=’checkbox’ name=’Imptnews_settings[Imptnews_checkbox_field_0]’ <?php checked( $options[‘Imptnews_checkbox_field_0′], 1 ); ?> value=’Enable Important News banner’>Enabale Important News Banner
<p><input type=”submit” name=”Submit” value=”Store Options” /></p>
<input type=”hidden” name=”action” value=”update” />
<input type=”hidden” name=”page_options” value=”ImportNewsid,Imptnews_settings” /></form>
</div>
The topic ‘What is wrong with this?’ is closed to new replies.