vendredi 6 novembre 2015

Dropdown List for plugin

I am developing a plugin, but I am clearly missing something.

My options for the check boxes I have created are saving, but I have also created a dropdown menu. The drop down menu doesn't save my selection for some reason. Thoughts?

//add for settings page    
add_settings_field("add-sizing", "Icon size", "add_sizing_function", "rcktcld-social", "admin_settings_section");


//register        
register_setting("admin_settings_section", "add-sizing");

        <?php function add_sizing_function() { ?>
            <select name="add-sizing">
                <option value="60" <?php selected( "add-sizing", 60 ); echo esc_attr( __( 'Select page' ) ); ?> >X-Large</option>
                <option value="48" <?php selected( "add-sizing", 48 ); echo esc_attr( __( 'Select page' ) ); ?> >Large</option>
                <option value="32" <?php selected( "add-sizing", 32 ); echo esc_attr( __( 'Select page' ) ); ?> >Medium</option>
                <option value="24" <?php selected( "add-sizing", 24 ); echo esc_attr( __( 'Select page' ) ); ?> >Small</option>

            </select>
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire