0

I remove the publish default button and add a custom submit button for the post page, but wordpress save it like a draft after showing the (js alert) dialog: "stay or leave the page?"

3
  • What exactly is your question?
    – fuxia
    Commented Sep 12, 2016 at 11:25
  • Is it not a question, but a solution!
    – SatuWeb
    Commented Sep 12, 2016 at 14:06
  • Then please split it up into a question and an answer.
    – fuxia
    Commented Sep 12, 2016 at 14:06

1 Answer 1

0

HERE THE SOLUTION: If you want remove the default publish button and use a custom submit button for your Custom Meta Box, you have to insert the submit_button in a <div class="submitbox" id="submitpost"></div> e.g.

<div class="submitbox" id="submitpost">
    <?php submit_button( 'Submit', 'primary', 'publish', false ); ?>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.