kompass/components/partials/form-start.php
2024-03-23 20:46:44 +01:00

18 lines
460 B
PHP

<?php
function kompass_prepare_form($params = [])
{
if (isset($params['page'])) {
echo ' <form method="post" action="admin.php?page=' .$params['page'] . '">';
}
echo '<input type="hidden" name="update_options" value="true" />';
foreach ($params as $key => $value) {
echo '<input type="hidden" name="' . $key . '" value="' . $value . '">';
}
}
function kompass_close_form(string $buttonText)
{
submit_button($buttonText,'button');
echo '</form>';
}