Recurrence Description field in JSON feed

Home Forums Calendar Products Events Calendar PRO Recurrence Description field in JSON feed

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1504811
    Marianne Steiner
    Participant

    How can I output the Recurrence Description field in each recurring event in the JSON feed?

    I tried the same way like custom fields (see: topic/custom-field-output-for-json-feed/, but that didn’t show up.

    
        'Termine'=> get_post_meta( $recurrence[description], '_ecp_custom_16', true ),
    

    The result in the JSON is:

    
    "Termine": false
    

    That’s somehat close, because it’s at least something.

    This code I tried, showed nothing:

    
        'Termine'=> get_post_meta( $event_id, 'recurrence-description', true ),
    
    
    "Termine" : ""
    

    Or would it be possible to autocopy the text from the Recurrence Description field into a custom field?

    #1506497
    Andras
    Keymaster

    Hi Marianne,

    Thanks for your question.

    The recurrence description is not saved like that as a metadata.

    It is saved as a serialized data, which looks like something like this:

    {
        "rules": [
            {
                "type": "Custom",
                "custom": {
                    "interval": "1",
                    "same-time": "yes",
                    "type": "Daily"
                },
                "end-type": "After",
                "end-count": "3",
                "EventStartDate": "2018-04-13 08:00:00",
                "EventEndDate": "2018-04-13 17:00:00"
            }
        ],
        "exclusions": [],
        "description": null
    }

    And the description is generated based on that on the fly with javaScript (and probably some black magic).

    I’m sorry I cannot be more helpful on this one. Let me know if you have any further questions on this.

    Cheers,
    Andras

    #1507706
    Marianne Steiner
    Participant

    Thanks for the information.

    I think this is true, but

    Recurrence Description, Use this field if you want to override the auto-generated descriptions of event recurrence

    So "description": null will transformed with some “black magic” or the like, but if a description is there, that would be used, I guess.

    So there must be a way to hook into that data to add it to the JSON feed or copy it to a custom field, but it propably would need some very dark black magic.

    So thanks András.

    This means I will create a new custom field and have the editors copy the text from the “Recurrence Description:” field to paste it in that new custom field.

    It’s not a very nice solution, but feasible.

    #1507933
    Andras
    Keymaster

    Hello and Happy Monday,

    Even if you have more rules set up (one weekly and then a custom because of February 29 or whatever, and then a monthly), that field will only show up once.

    I can try to check if it would be possible to automatically copy the description of the first rule into that field if that helps. Let me know.

    Cheers,
    Andras

    #1511869
    Marianne Steiner
    Participant

    Hello András

    It would probably help but I solved it the pragmatic way and just created a new custom field and have the content editor copy & paste the contents from one field to the other. Or using the new field exclusively for this additional information that is used on a third website.

    It’s fully working now and “documented” (with links to the threads here on https://github.com/zu/Avada-Child-Theme)

    #1511929
    Andras
    Keymaster

    Great Marianne, I’m happy to hear you found a workaround. Awesome!

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.

    Cheers,
    Andras

    PS: We’d be grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Thanks!

    PS2: If you like our plugins, and you didn’t yet do so 🙂 we would also be happy to receive a review in the wordpress.org repository. Much appreciated!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Recurrence Description field in JSON feed’ is closed to new replies.