EE4 Custom Post Types

Any requests to get_posts of type ‘espresso_events’ or ‘espresso_venues’ automatically have an attached EE_Event or EE_Venue object, which contains extra info (like extra Event metadata, or Venue location data), and also has functions for easily getting related data.

Eg, the EE_Event object has functions like is_active() (determines if the event is considered “Active” or not, taking into account the event’s status, whether all the datetimes for the event have passed, and other factors), tickets() (which retrieves all the non-archived tickets for that event), datetimes_ordered() (which retrieves all the datetimes for the event, ordered by time), etc. (See core/db_classes/EE_Event.class.php).

“Event CPT” data includes normal post data including:

  • Title
  • Description
  • Tags
  • Categories
  • Featured Image
  • Commenting
  • Excerpt
  • Custom Fields
  • Slug
  • Author

 

This data can be queried and displayed in themes along with other post data.

Need more help?

  • Browse or search for more information on this topic in our support forums. Customers with an active support license can open a support topic and get help from Event Espresso staff.
  • Have an emergency? Purchase a support token and get expedited one-on-one help!
  • Go back to documentation for Event Espresso
Event Espresso - Staging Server