Auto-publish events submitted by logged in users

In the Community Events settings, you can control the status of events that are submitted via the Add Event form. But perhaps you'd like a little more control over that.

The snippet below will auto-publish any event submitted by a registered, logged in user. Any other submitted events (i.e., those submitted by anonymous users) will go to whatever your default status is set to (e.g. Draft or Pending Review).

To add this auto-publishing feature, copy the snippet below into your theme's functions.php file.