• I’m developing a plugin. It’s really easy to use single input fields like a textbox but when it comes to checkboxes and dropdowns which I need for my plugin I’m lost.

    So this is my code for a single field:

    <tr valign="top">
    	<th scope="row">Height (in pixels)</th>
    		<td><input style="width: 200px;" type="text" name="height" value="' . get_option('height') . '" /></td>
    </tr>

    Register the settings
    register_setting( 'my-settings-group', 'height' );

    and implementing it to a variable
    $height = get_option('height');

    And then I can put wherever I want. But with checkboxes and dropdowns this method doesn’t work. Any ideas of implementing checkboxes in the same level of simplicity?

The topic ‘Using checkboxes, dropdowns, radiobuttons in plugins.’ is closed to new replies.