WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Saving Custom Fields from front end submission (7 posts)

  1. davidpike7
    Member
    Posted 2 years ago #

    Hello

    This has been touched on previous posts, but I seem to be going wrong somewhere so was wondering if anyone had any suggestions.

    I've added the input to event-editor.php in my theme folder (which is showing up)

    I've then added the other chunk of code to my functions.php

    The function seems to work fine if I manually put in the email. I can't find a way to test whether I'm getting anything from $_POST.

    Also how do I get the event ID to set it as the post id to run update_post_meta?

    I'm using ACF for the backend so this is just for the frontend submission.

    http://hastebin.com/hafewelipa.xml

    Many thanks

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

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    if you add event attributes (see our docs), they are actually custom fields as well, but they'll also show up in the front-end

  3. davidpike7
    Member
    Posted 2 years ago #

    Thanks Marcus, but I previously tried to use attributes and it conflicted with ACF and some of the of the custom fields are fairly complex, post relationships/image uploads etc, so I'd prefer to do it this way.

    Should I not be able access the contents of $_POST using this?

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    yes, this should be possible. from the looks of it, you should change the number 670 with EM_Event->event_id

  5. davidpike7
    Member
    Posted 2 years ago #

    Cheers Marcus. So I've managed to get the event id. I ended up using EM_Event->post_id as ACF is using the custom field from the event post type and this worked perfectly.

    However the contents of $_POST seems empty? Stupid question but is there a way I can print out the contents of post whilst running the filter I tried print_r($_POST) but it didn't seem to do anything.

    thanks

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    should be available... what about $_REQUEST?

  7. davidpike7
    Member
    Posted 2 years ago #

    I was able to echo out the contents of the request/post when I removed 'return $result;' but obviously this breaks the event manager functionality.

    If I add the 'return' the contents of the $_REQUEST/$_POST don't seem to enter the custom field.

    Any idea what could be causing this? Is there a way I can print out the contents of $_POST (just to test it out) without removing the 'return'?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic