Events Made Easy › Forums › Bug fixed or feature request implemented › add action to event submit
Tagged: hooks actions
- This topic has 7 replies, 3 voices, and was last updated 14 years, 10 months ago by
Anonymous.
-
AuthorPosts
-
Tue 11 Jan 2011 at 02:25 #42398
Anonymous
Inactivei want to add an action to the new event creation process so that when i create the event an extra piece of data gets stored somewhere. specifically: i create a unique twitter hashtag that shows on every event page — it looks like this “twitteracct#M#d#Y” — but when i create an event, i also want to save this tag to a list of all tags.
is there an easy way to hook into the event creation function, so that in addition to calling event_create() or whatever, i can also call add_hashtag(‘tagname’)?
sorry if this is covered in the documentation — didn’t see anything about hooks or filters on the website though…
Tue 11 Jan 2011 at 08:31 #46116Franky
KeymasterNo hooks yet. But I’ll try to add some later on.
Tue 11 Jan 2011 at 18:36 #46117Franky
KeymasterI added an action after inserting or updating an event in the db:
eme_insert_event_action (1 parameter: $event)
eme_update_event_action (1 parameter: $event)
I also added a filter for the events list:
eme_event_list_filter (1 parameter: array of events)
Update to the trunk version (http://downloads.wordpress.org/plugin/events-manager-extended.zip) and let me know the result 🙂
Tue 11 Jan 2011 at 22:14 #46118Anonymous
Inactiveyou’re amazing, franky.
the first two events are pretty self-explanatory, but to clarify for the next guy can you explain when this happens — eme_event_list_filter ? does this happen when stuff gets outputted; and if so, is it just lists or single events too?
thanks so much!!
Tue 11 Jan 2011 at 22:27 #46119Franky
Keymastereme_event_list_filter allows you to play with the result of e.g. [events_list], so you can add/remove events/info etc…
Btw: did you test the action hooks?
Thu 13 Jan 2011 at 01:43 #46120Anonymous
InactiveI haven’t worked with tags too much like the 2 action tags you’ve created. Would these be put into the ‘header.php’ file or what?
And once an Event is added (submitted), does this action take place with the file being called? ( I guess that’s why I want to know which file would be best to put this in. Since header.php gets called every time, it seems a good place to put it, checking with a conditional. Would that be right?)
What file is used to display single events on the front end?
Thanks for any help on this!
Thu 13 Jan 2011 at 07:39 #46121Franky
KeymasterIf you want to use actions, read up on the wordpress doc: http://codex.wordpress.org/Function_Reference/add_action , you’ll want this in your theme’s function.php
Sat 19 Feb 2011 at 23:53 #46122Anonymous
InactiveHi, thanks for the clarification above. The events_list_filter is a really good idea!
As to the eme_insert_event_action, it works like a charm.
Thanks again.
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.