I have a function on a page which takes a user to another page if the action is equal to 'add'. I now want to create a button which will do this for me without typing &action=add into the url.
The function looks like this:
function consultants_page() {
if (isset($_GET['action']) && $_GET['action'] == 'add') {
require( get_template_directory() . '/settings/pages/consultant_add.php' );
}else {
require( get_template_directory() . '/settings/pages/consultant.php');
}
}
I then need to amend this button to link to this function, but it isn't currently working..
<form method="get" action="add">
<p class="submit"><input type="submit" name="add" id="submit" class="button button-primary" value="Add"></p>
</form>
cheers