Any ideas how I could add a cancel button, like the default one in the Publish meta box, to a custom meta box?
The standard code is <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel">Cancel</a>
I guess it's using some js to do the cancel/reset action so it's not easy to replicate.
I basically want to add a button that will clear an input field in my meta box. input type=reset
will clear all the fields on the page, so I wanted to see if I could use WP's toolset.
Open to ideas for the best solution here.
Any ideas how I could add a cancel button, like the default one in the Publish meta box, to a custom meta box?
The standard code is <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel">Cancel</a>
I guess it's using some js to do the cancel/reset action so it's not easy to replicate.
I basically want to add a button that will clear an input field in my meta box. input type=reset
will clear all the fields on the page, so I wanted to see if I could use WP's toolset.
Open to ideas for the best solution here.
I ended up using this:
<a class="clear_button hide-if-no-js button-cancel" title="clear" data-clear style="text-decoration:underline;">Clear</a>
It does the job. I was hoping for something more "Wordpressy" but don't see a metabox cancel function.