Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter madbaker

    (@madbaker)

    Thanks for the lead. I’ll dig into it. 🙂

    Thread Starter madbaker

    (@madbaker)

    Oh boy, I got it working, but totally confused myself in the process.

    I downloaded a plugin called “Simply Show Hooks” to show me what hooks were firing when the ticket list was being displayed.

    ’em_booking_form_tickets_loop_header’ placed the field too high. In the header, I assume. No real surprise.
    ’em_booking_form_tickets_loop_footer’ placed the field too low. In the footer. No surprise either.

    My only other option was ’em_booking_form_tickets_col_available’, but that’s the function I built!

    For the heck of it, I tried it. My add_action statement is:

    add_action(’em_booking_form_tickets_col_available’,’em_booking_form_tickets_col_available’,10,1); (I only pass $EM_Event as an argument)

    So the add_action hooks to itself?! But it works. I don’t know how, but it works.

    I realize I’m new to wordpress programming and am diligently reading the codex, but if anyone can explain how that add_action statement is valid I’d love to hear it. Or point me to a link, etc.

    Thanks,

    Mark

    PS – I’m sharing this all just in case someone has a similar problem in the future. If there’s a better place to write this up let me know.

    Thread Starter madbaker

    (@madbaker)

    Hi again,

    I’ve been trying so hard to figure this out on my own but I’m stumped. I hope you can help me out.

    Here’s what I’ve done so far:

    – copied tickets-list.php to my theme plugin folder as you’ve described in your documentation.

    – created my own ‘customization’ plugin to put my changes

    – created a function in the ‘customization’ plugin based on the code snippet to change the ticket column headers to new values and add a fourth column called ‘available’. This works fine.

    – Added a new function called ’em_booking_form_tickets_col_available’ which will be called from the switch statement in tickets-list.php using the do_action() function in the default case.

    I’m pretty sure I need to have an ‘add_action()’ for my new function, so it can get called by the do_action statement. Without it, my function doesn’t get called at all.
    But I’m not sure how to form the add_action statement.

    What ’em_’ function am I hooking into? I tried to hook into ’em_booking_form_tickets_cols’, but it’s giving me errors unless I phrase my function as a class in the add_action statement. But I’m confused as to what class my function is part of!

    I’ve searched the forums and the pastebin as best I can, looking for a similar add_action statement but can’t seem to find the correct hook.

    Thanks,

    Mark

    Hi. Check out this thread. The awesome support folks helped me change the title one column over. 🙂

    I assume we’re both talking about the same form.

    https://ww.wp.xz.cn/support/topic/changing-name-of-and-displaying-spaces/#post-9442066

    Mark

    Thread Starter madbaker

    (@madbaker)

    Wow, thank you so much. That worked perfectly.

    I noticed that the quantity in the picklist for each ticket type is equal to the number of available tickets, so that will be sufficient for what I need.

    Although I’m going to look for the hook where each ticket type is displayed, so I can display the # available in a new column.

    I appreciate the article about where to paste the snippet too. I made a ‘customize’ plugin in case I want to add a few more tweaks.

    I really appreciate the help.

    Mark

Viewing 5 replies - 1 through 5 (of 5 total)