How to get additional fields using Event Calendar api?

Home Forums Calendar Products Community Events How to get additional fields using Event Calendar api?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1100684
    DAVID
    Participant

    Hey Guys,
    So I am not using your hierarchy of templates for single event page.

    Now I want to add “Additional Fields” into my UI but I am not able to find any function from knowledge base which does the same. I tried $fields variable from events-calendar-pro/src/views/pro/modules/meta/additional-fields.php but it isn’t working.

    Please let me know how to access additional fields in an array format.

    • This topic was modified 10 years ago by DAVID.
    • This topic was modified 10 years ago by George.
    #1100875
    George
    Participant

    Hey @DAVID,

    You should be able to use the function tribe_get_custom_fields() to get the additional fields and their content for a post.

    So, something like this:


    $fields = tribe_get_custom_fields( get_the_ID() );

    foreach( $fields as $field ) {
    // Your custom code....
    }

    We cannot help with custom coding much so to learn more about this function I would recommend reading the function’s code directly and tinkering a bit. You can find this function in this file inside Events Calendar Pro:


    events-calendar-pro/src/functions/template-tags/general.php

    Head to around line 157 and you’ll see the function defined there.

    I hope that helps!
    George

    #1107170
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to get additional fields using Event Calendar api?’ is closed to new replies.