In WordPress, the submit_button() function echoes a submit button. However, there are occasions where one might need a submit button, but not echoed. Like when returning a form from a function. For those occasions, use the get_submit_button() function instead. get_submit_button() accepts the same arguments as submit_button(), but returns instead of echoing.
Returning a submit button
Share this post!
Check out these most recent posts:
Toggling the visibility of a metabox using a form requires the metabox to have a custom class. This is how to add custom classes to a metabox.
Using a datepicker when choosing dates is a much nicer user experience. See the best way to add a jQuery DatePicker to a WordPress plugin.
Formidable is a great WordPress forms plugin, but it doesn’t include a Customizer control for listing your forms. Here’s I made one.
Adding a custom class to a submit button can make certain designs easier to manage. Check out this super-simple solution.
In case you haven’t heard, ArtistData is shutting down, so the ArtistDataPress plugin will also be shutting down as of October 14.
If you’re getting an error related to the get_theme_mod function, the solution is simpler than you think. Check out this solution.