Additional Field with Default Content (Text Area)

Home Forums Calendar Products Events Calendar PRO Additional Field with Default Content (Text Area)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1101289
    Kevin
    Participant

    I’m hoping to create an additional field in the add event form that is a text area – but I would like it to be populated with default content that can be changed by the organizer if they wish. Is that possible? Thanks again.

    #1101370
    Geoff
    Member

    Hey Kevin — good question!

    Text areas are definitely possible in the additional fields settings, though I’m afraid that setting it up with default content is not. That sounds like it would make an excellent idea in our feature request forum.

    You might be able to pull that off with Advanced Custom Fields instead, but I’m sorry it isn’t baked right into The Events Calendar.

    Geoff

    #1101389
    Kevin
    Participant

    I have added the feature request and hopefully other users jump on it. I checked out the Advance Custom Fields plugin your referenced. Perhaps i’m not using it correctly – but it seems to not affect the Events Calendar Additional Fields which is what I think i need to do in order update the ADD EVENT fields.

    #1101912
    Geoff
    Member

    Thanks for doing that, Kevin! I’d love to see others jump on that as well.

    You’re right — ACF will not directly affect the calendar’s custom fields, but you can add an ACF field to Events posts and then modify the single event view template to incorporate the ACF field.

    Sorry again for not having a concrete answer for you here, but I hope this at least helps answer your question.

    Cheers,
    Geoff

    #1102905
    Jayson
    Participant

    I solved it this way:

    // add all tickets to a ticket category and add events category to tickets on creation
    add_filter( ‘wootickets_after_save_ticket’, ‘tribe_add_category_to_woocommerce_tickets’ );
    function tribe_add_category_to_woocommerce_tickets( $ticket_id ) {

    //add full name requirement on save
    global $wpdb;
    $meta_enabled=1;
    //Copy this string from phpmyAdmin after saving the default string. It’s in the post_meta table
    $metaval= ‘a:1:{i:0;a:5:{s:4:”type”;s:4:”text”;s:8:”required”;s:2:”on”;s:5:”label”;s:9:”Full name”;s:4:”slug”;s:9:”full-name”;s:5:”extra”;a:0:{}}}’;

    delete_post_meta($ticket_id, ‘_tribe_tickets_meta_enabled’);
    //replace “tpp_” with your wordpress database prefix
    $wpdb->insert(‘tpp_postmeta’, array(
    ‘post_id’ => $ticket_id,
    ‘meta_key’ => ‘_tribe_tickets_meta_enabled’,
    ‘meta_value’ => $meta_enabled
    ));

    //ignore if enter already in – need to code
    delete_post_meta($ticket_id, ‘_tribe_tickets_meta’);
    $wpdb->insert(‘tpp_postmeta’, array(
    ‘post_id’ => $ticket_id,
    ‘meta_key’ => ‘_tribe_tickets_meta’,
    ‘meta_value’ => $metaval
    ));

    }

    #1102973
    Geoff
    Member

    Hey Jayson, thanks for chiming in!

    That’s an interesting way to go — it looks like this is slightly different than what Kevin is looking for but I certainly do appreciate you dropping this in. 🙂

    Cheers,
    Geoff

    #1109106
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Additional Field with Default Content (Text Area)’ is closed to new replies.