WordPress: Publish Button Event Handler

013th Jul 2013Uncategorized, , ,

I’ve been working on a new project in WordPress, and I needed a way to do some validation with JavaScript when clicking the “Publish” button.

So, here’s the easy snippet:

  // When the "Publish" button is clicked.
    // Check our condition.
      alert( "Message here telling why the post can't be submitted." );
      return false;

No Comments Comments Feed

Add a Comment

Before you post, please prove you are sentient.

What is 7 times 9?