Posted: November 25, 2013 at 2:31 pm
|
In the ical.php file I see lines like this “LOCATION:” . $_REQUEST[‘location’] . “\n” . I have created Event Meta for Virtual Password that I would want added to the ical import. But I am not sure how to change the line above to pull in event meta. Could someone guide me in the right direction for what that line would look like? Much appreciated. Completely lost on this one. Thanks |
|
Hi James, You need to modify the function below it first espresso_ical_prepare_by_meta. There is an array where you can add a key value pair so you can add in the meta data. Then in the first function you can call that data and add it to the ICAL. |
|
OK just not clear on syntax. The line towards the top I have “DESCRIPTION:” . $_REQUEST[‘event_virtualpassword’] . “\n” . And at the bottom of the file in the function you are referring too I have ‘event_virtualpassword’ => $meta[‘event_virtualpassword’], No value gets returned. |
|
Try 'event_virtualpassword' => do_shortcode("[EE_META type='event_meta' name='event_virtualpassword']") Tehe $meta variable doesn’t contain the event meta as it isn’t a true custom post type (4.0 will be!) so you need to grab the data another way. |
|
Perhaps we are getting closer. However, it returns no data. Now I have “DESCRIPTION: this is a test ” . $_REQUEST[‘event_virtualpassword’] . “\n” . (It displays this is a test in the description area of the calendar entry but event_virtualpassword is left blank) and lower in the file ‘event_virtualpassword’ => do_shortcode(“[EE_META type=’event_meta’ name=’event_virtualpassword’]”), In my custom functions file I have (just to confirm the value for the event meta is correct. if (!function_exists(‘ee_default_event_meta’)){ ); |
|
The ee_default_event_meta defines the event meta fields for when you create a new event. The event that you are working with, when you open it in the event editor, does it have the event_virtualpassword field in it? |
|
yes it does. i added it to the custom functions.php file so it displays as an event meta option as default. Now i am trying to get that field to show up in the description of the ical import. |
|
As a debugging measure, I would change line 101 of ical.php to: $url = add_query_arg( $array, site_url() );var_dump($array); Once you’ve confirmed that it’s not there, you can go into includes/shortcodes.php and change line 894 to: global $event_meta, $venue_meta, $all_meta;var_dump($event_meta); Are you using the ical link in an email, on the event list page, or the event registration page? |
|
I am using the ical in an email |
|
Because it’s in the email, the $event_meta global hasn’t been populated. You can fix this by adding: global $event_meta; $event_meta = unserialize($wpdb->get_var($wpdb->prepare("SELECT event_meta FROM " . EVENTS_DETAIL_TABLE . " WHERE id=%d", $meta['event_id']))); anywhere in the function espresso_ical_prepare_by_meta (second function in ical.php) prior to the array declaration. Then when you use the do_shortcode in the array declaration, the $event_meta global will work. |
The support post ‘ICAL and event meta question’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.