• Resolved andi1984

    (@andi1984)


    Hi,

    I want to adapt the event manager plugin to fit my own needs.

    In special I want to add a new status for ‘not sure’ which can be set when people don’t know if they will attend an event or not.

    But I’m a little bit confused about the do_action WP Core function because I don’t know how and where it’s redirected to.

    In special in file em_booking.php, line 98:

    do_action('em_booking', $this, $booking_data);

    Where is this method call being evaluated? In which file etc? Sorry for this, maybe really beginner question, but I don’t see where this is going to be evaluated. Exactly the same for all the other do_action calls. I’m familar with PHP, but I don’t get the working mechanism of this call.

    Can somebody help me?

    http://wordpress.org/extend/plugins/events-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    This is an action in WP which you can hook into. http://codex.wordpress.org/Plugin_API

    You could get this working by adding to $this->status_array (see a few lines up) and I’d advise using a key > 10

    You’ll also probably want to assign the $EM_Booking->booking_status to that key number e.g. in the action em_booking_add

    Thread Starter andi1984

    (@andi1984)

    Thanks for your feedback Marcus.

    What I miss is, according to API, a Action Function which is hooked into ’em_booking’.

    Which function exactly is going to be executed after the call of do_action(…)?

    Same for:

    `do_action(’em_booking_add’, $EM_Event, $EM_Booking, $post_validation);’

    to which you refer, where I should add the corresponding booking_status. So I hook into the WP action ’em_booking_add’ with the three parameters. But which Action Function is fired? And where can I find the corresponding action?

    In the API example it’s clear, because I can find a corresponding add_action. But here I can’t.

    Sorry. I don’t get. But with high probability it’s really easy. But for me a link between do_action and the (for me unknown) function (which is hooked into this em_booking_add call).

    Sorry for my “stupidity”.

    Greets,

    Andreas

    Thread Starter andi1984

    (@andi1984)

    Ahhh… I found it. My fault was to only search for do_action, but you do it with filters.

    Bing! Problem solved! Thanks for help!

    Thread Starter andi1984

    (@andi1984)

    Ahh no, you apply filter.

    But the same question where do you add filter?

    How is the function addin em-bookings.php connected to

    `do_action(’em_booking_add’, $EM_Event, $EM_Booking, $post_validation);’

    I guess you call the add function with this line of code, don’t you? If yes, where do you specify that you want to call the add function in em-bookings.php?

    Do you know what I mean? Where is the connection?

    Thread Starter andi1984

    (@andi1984)

    Whoops, typo in last post. I mean the function add not `addin’

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    all we do is provide a hook for you to access the three variables there at that specific point in time, so you you can then e.g. modify the event or the booking information after it has been added

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Events Manager] do_action('em_booking', $this, $booking_data);’ is closed to new replies.