February 1, 2010

Fix for the Wordpress Theme Studiopress for WordpressMU

The Studiopress theme for WordpressMU is broken. When you try to update the options you get the message “options page not found”. I have fixed the issue:
[code]
18a19
> if ( is_admin() ){ // admin actions
19a21,30
> add_action('admin_init', 'register_mysettings' );
>
> } else {
> // non-admin enqueues, actions, and filters
> }
>
> function register_mysettings() { // whitelist options
>   register_setting( 'Theme Options', 'greeting' );
>   register_setting( 'Theme Options', 'welcomemessage' );
> }
27c38
<   <div class='wrap'>
---
>   <div>
30a42,43
> <?php settings_fields('greeting,welcomemessage'); ?>
>
35c48
<   <p><input type="submit" name="Submit" value="Update Options" /></p>
---
>   <p><input type="submit" name="Submit" value="<?php _e('Update Options'); ?>" /></p>
37a51
> <?php settings_fields( 'Theme Options' ); ?>
43c57
< ?>
\ No newline at end of file
---
> ?>

[/code]