Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I tried the Satoshi Theme in Wordpress 3.1 and when the Theme Options are saved, they do get saved but the "Satoshi Options Saved." message is not displayed. (the message is displayed in Wordpress 3.0.4).

functions.php:

/* -- Theme Options Page -- */
function theme_options_admin() {
    $option_fields = array();
    if ( $_GET['updated'] ) echo '<div id="message" class="updated fade"><p>Satoshi Options Saved.</p></div>';
    echo '<link rel="stylesheet" href="'.get_bloginfo('template_url').'/styles/functions.css" />';
?>

<div class="wrap">

    <h2>Satoshi Options</h2>

    <div id="message"></div>

    <div class="metabox-holder">

        <form method="post" action="options.php">
            <?php wp_nonce_field('update-options'); ?>

            <div id="theme-options">

                <div id="left-column">
                    <?php
                        include("options/custom-logo.php");
                        include("options/custom-intro.php");
                        include("options/frontpage-headline.php");
                        include("options/featured-project.php");
                    ?>
                </div><!--end left-column-->
                <div id="right-column">
                    <?php
                        include("options/contact-details.php");
                        include("options/footer-text.php");
                        include("options/google-analytics.php");
                    ?>
                </div><!--end right-column-->

            </div><!--theme-options-->

            <input type="hidden" name="action" value="update" />
            <input type="hidden" name="page_options" value="<?php echo implode(",", $option_fields); ?>" />

        </form>
    </div><!--end metabox-holder-->
</div><!--end wrap-->
<?php
}
add_action('admin_menu', "theme_options_admin_init");
function theme_options_admin_init()
{
    add_theme_page( "Satoshi Theme Options", "Theme Options", 8, __FILE__, 'theme_options_admin');
}
share|improve this question
    
Adding a comment so you spot the update, have updated my answer. –  t31os Jan 22 '11 at 10:51
add comment

1 Answer 1

up vote 2 down vote accepted

This line is wrong, i couldn't even get the theme options page up without changing it..

add_theme_page( "Satoshi Theme Options", "Theme Options", 8, __FILE__, 'theme_options_admin');

Update that to read something like..

add_theme_page( "Satoshi Theme Options", "Theme Options", 8, 'satoshi-theme-options', 'theme_options_admin');

Saving options did produce the updated message as expected.

UPDATE: Looks like the $_GET key has changed in 3.1 when performing settings updates.

Update the following line.

if ( $_GET['updated'] ) echo '<div id="message" class="updated fade"><p>Satoshi Options Saved.</p></div>';

To..

if ( $_GET['settings-updated'] ) echo '<div id="message" class="updated fade"><p>Satoshi Options Saved.</p></div>';

And you'll now see the updated message when saving.

share|improve this answer
    
Hi again! I used your code but the message still not appearing in Wordpress 3.1 –  janoChen Jan 22 '11 at 10:09
    
Yes sorry, i tested the wrong version, i'll go check now.. ;) EDIT: Updated my answer. –  t31os Jan 22 '11 at 10:12
    
Thanks, you always answer my questions, are you Wordpress developer or what. –  janoChen Jan 22 '11 at 10:59
    
I'm just a coder(coding is a hobby) that loves to use WordPress. Nothing special, just a guy with a hobby!... ;) Happy to help in any case. –  t31os Jan 22 '11 at 12:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.