Support » Plugin: EventPress » EventPress Hooks / Customization

  • Kunal,

    I have a few quick questions about how to customize my install of EventPress…

    If I want to have subscribers be able to create events, but don’t want them to go public until an admin approves them, is there a hook in your plugin that will allow me to have all new events have a ‘pending’ status?

    I am currently using Justin Tadlock’s Members plugin to grant subscribers the ‘publish_event’ capability. Is there a more elegant way of doing this with your plugin?

    Also, I would like to have users be able to select from the categories created by an admin when creating an event. Is there a hook for adding elements to create.php or do I need to create an alternate copy in my theme? If I add an element to the form, what is the best way to be sure it is passed to wp_insert_post properly?

    Also, as a side note, I have created an AJAX calendar widget for EventPress. Would you be interested in checking it out for possible inclusion in EventPress, or should I release it as a stand-alone plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author kunalb


    1. So as events are just a custom post type, you can hook into post creation and save modify the post status after checking the post type and owner. However, there isn’t any front end support in BP about pending posts, etc. so it might not exactly work out.

    2. The event creator role was made explicitly for this functionality. It allows only event creation and nothing else — so you can make this the default role for users.

    3. Again, for the front end there’s no support for categories and tags (planned in 0.1.3) — so even if you do assign categories and tags they won’t display correctly. And the edit form actually inherits any custom metaboxes you may right from the admin backend — so you can use the standard way of adding a metabox.

    4. I’ll definitely be interested in having a look at your code — I’ll be making a general access point for EventPress related Ajax calls — so I can build from yours/atleast get an idea. Stuff like this is what I’ve planned to include in the calendar overhall for EventPress 0.1.3.

    Thanks for the info.

    Good to know about the meta boxes… I will have to get that setup!

    As far as the code for the calendar widget, you can download a copy of the widget in plugin form here. If you would like to see a working version of the widget, you can find it (and a site about to launch using EventPress) at the bottom of the homepage.


    Plugin Author kunalb


    Hey — the widget looks great! However, I’m rather drastically modifying the code to display the calendar, as well as the behaviour of both the calendar page and the calendar widget, so won’t be able to use your code directly. You might want to release it as a plugin for people wanting an alternate EventPress calendar widget (the one I have planned for EP is a bit different).

    No problem. Thanks for checking it out and feel free to use any part of it you want. I am interested in seeing the code for your widget… I am sure I could probably learn a few things!

    Just a thought for a future version of EventPress: How about creating a capability called ‘create_event’ in addition to ‘publish_events’? Currently, if I remove a user’s ability to publish_events, they are redirected to the events directory if they try to publish an event from the front-end event creation form (which is normally hidden from them, but not unaccessible). It would be great if users with the create_event capability could see the ‘Create Event’ links and be able to send events to an admin as ‘pending’. When such a user submits the event form, they would given a ‘Thank you for submitting event’ message rather than being redirected to the events directory.

    I currently have granted subscribers the ‘publish_events’ capability and then wrote a filter to change any events they create to have a ‘pending’ status. Problem is, there is no message indicating that the event was actually created. As such, a user might create an event multiple times thinking there was some sort of error. I will have to do some extra coding to provide that message, but it would be great if all of this was built-in!

    Plugin Author kunalb


    Nah, your code is better. I have a lot to learn before becoming a good/decent developer (writing testable code, for one thing). Just the features will be a bit different.

    I was following the existing WordPress capability structure — and that seems to be working, more or less. The actual problem is the frontend publish metabox; I need to make it like the internal metabox and show all the statuses, etc. I’;ll first try to see if I can directly use that code, but if that fails I’ll roll my own for that. BPCP 0.1.4 I guess.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘EventPress Hooks / Customization’ is closed to new replies.