Forums

[resolved] Not Saving Settings (1 post)

  1. mme
    Member
    Posted 1 year ago #

    Why is this not saving my setting?

    add_action('admin_menu', 'md_scroll');
    
    function md_scroll() {
    
    	//create new top-level menu
    	add_pages_page('Scrolling Text', 'Scrolling Text', 8, __FILE__, 'md_scroll_settings_page');
    
    	//call register settings function
    	add_action( 'admin_init', 'register_md_scroll' );
    }
    
    function register_md_scroll() {
    	//register our settings
    	register_setting( 'md_scroll', 'md_scroll_text' );
    
    }
    
    function md_scroll_settings_page() {
    ?>
    <div class="wrap">
    <h2>Scrolling Text</h2>
    
    <form method="post" action="options.php">
        <?php settings_fields( 'md_scroll' ); ?>
        <table class="form-table">
            <tr valign="top">
            <th scope="row">Scrolling Text:</th>
            <td><input type="text" name="'md_scroll_text" value="<?php echo get_option('md_scroll_text'); ?>" /></td>
            </tr>
        </table>         
    
        <p class="submit">
        <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
        </p>
    
    </form>
    </div>
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.