• Resolved tred1975

    (@tred1975)


    Hi,
    is it possible to get the data from a plugin like WP Event Manager? In getting the data filled dynamically per event:

    <?php
        global $post;
        $start_date = get_event_start_date();
        $end_date   = get_event_end_date();
        $start_time = get_event_start_time();
        $end_time   = get_event_end_time();
        $address = get_event_address();
        $location =  get_event_location();
        $separator = get_wpem_date_time_separator();
        $check_ticket_visibility = get_option('event_manager_enable_event_ticket_prices_filter', true);
        wp_enqueue_script('wp-event-manager-slick-script');
        wp_enqueue_style('wp-event-manager-slick-style');
        do_action('set_single_listing_view_count');
        $event = $post;
        ?>
        <!-- Add to Calendar Button -->
        <div class="calendar-button-container">
            <add-to-calendar-button
                name="<?php echo esc_attr(get_the_title()); ?>"
                start-date="<?php echo esc_attr(date('Y-m-d', strtotime($start_date))); ?>"
                start-time="<?php echo esc_attr(date('H:i:s', strtotime($start_time))); ?>"
                end-time="<?php echo esc_attr(date('H:i:s', strtotime($end_time))); ?>"
                time-zone="<?php echo esc_attr(get_the_event_timezone()); ?>"
                location="<?php echo esc_attr(get_event_location()); ?>"
                description="<?php echo esc_attr(wp_strip_all_tags(get_the_content())); ?>"
                :options='["Apple", "Google", "iCal", "Outlook.com", "Microsoft 365", "Microsoft Teams", "Yahoo"]'
                light-mode="bodyScheme"
            ></add-to-calendar-button>
        </div>
        <!-- End of Add to Calendar Button -->
Viewing 1 replies (of 1 total)
  • Plugin Author Add to Calendar

    (@add2cal)

    When you are on PHP code level, you can simply use the <add-to-calendar-button> tag. When you change the attributes, the button automatically adjusts. This would even apply if you change attributes via JavaScript later.

    Therefore, as long as the plugin is installed (or you included the script via CDN, see https://add-to-calendar-button.com/use), the only reason why this would not work, would be the other plugin where you pull the event data from.

    One advice: Add the “debug” attribute (simply “debug” or debug=”true”). You can remove this later, but while developing, it shows you more information on what’s not right (like formatting, etc. – I can see in your code that you are using an unsupported format for the time, for example).

    Also check out the “Configuration” docs and examples at https://add-to-calendar-button.com/ for more insights.

Viewing 1 replies (of 1 total)
  • The topic ‘Retrieve date from an event manager plugin’ is closed to new replies.