WordPress Plugin: How to add a separate page for editing a form

OK so i have a plugin which has its own settings page and all. In the settings i have a form that will display data from a custom table. It looks like this:

    <form method="post" action="">
        <table>
            <tbody>
                <tr>
                    <th>StringVal1</th>
                    <th>Checked</th>
                    <th>StringVal2</th>
                    <th>StringVal3</th>
                    <th>Configurations</th>
                </tr>

                <tr>
                    <td>
                        <?php echo "Value from table"; ?>
                    </td>
                    <td>
                        <?php
                            if ($row["Checked"] == 1) {
                                $checked = ' checked="checked" ';
                            }
                            echo "<input name='Checked' type='checkbox' " . $checked . " />";
                        ?>
                    </td>
                    <td>
                        <?php echo "Another value from table"; ?>
                    </td>
                    <td>
                        <?php echo "More value from table"; ?>
                    </td>
                    <th>
                        <div align="center">
                            <input name="EditButton" type="submit" class="edit-secondary" value="Edit">
                        </div>
                    </th>
                </tr>
            </tbody>
        </table>
    </form>

When the “Edit” Button is clicked i want to link to another page (for ex. /wp-admin/plugins.php?page=myplugin-settings/edit-form) in order to edit and insert delete rows from the table. So how can i add that extra page i need?

Related posts

Leave a Reply