WordPress trigger update/publish button click from functions.php file

My custom post type section is quite long, so I’ve broken it up into 7 “steps” with buttons added via jquery that take the user to the next “step” by hiding the first section and revealing the next.

How would I trigger the publish or update button click when clicking on the “next step” button?

Read More

I’ve tried several solutions – none seem to be working.

The “step button” code:

jQuery('#button-1').live('click',function(){    
    jQuery('#acf_89').show();
    jQuery('#acf_88').hide();           
 });

Related posts

Leave a Reply

2 comments

  1. To trigger a button click event you can call .click()

    jQuery('#button-1').live('click',function(){    
        jQuery('#acf_89').show();
        jQuery('#acf_88').hide();   
        $("#button_id").click();
     });
    
  2. The problem with triggering a click on the “Update” button is that you will reload the page and lose your position in your custom walk-through wizard.

    To save the post on the fly you will need to augment your WordPress install with something like Ajax Post Save