• Resolved mlcom

    (@mlcom)


    Hello,

    I was wondering if there is a way to get the ID or name of the google calendar within the lvgc_each_output_data hook in functions.php.

    I want to change the output for different google calendars differently, so I need a way to differentiate them.

    Thanks for the great plugin and your support.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author kimipooh

    (@kimipooh)

    It can be obtained if it means the Google Calendar ID (***@group.calendar.google.com).
    By specifying the hook argument as 3, all data from Google Calendar can be obtained.

    In the following example, please look at $gc_value.
    For each event, the Google Calendar ID is stored in $gc_value[“organizer”][“email”].
    To see what data can be obtained from Google Calendar,
    var_dump($gc_value)

    sample code:

    add_filter( 'lvgc_each_output_data' , 'lvgc_each_output_data_func' , 10 , 3 );

    function lvgc_each_output_data_func($out, $out_atts, $gc_value){
    extract($out_atts);
    $hook_secret_key = '............';

    $google_calendar_id = $gc_value["organizer"]["email"];

    }

    • This reply was modified 2 months ago by kimipooh.
    Thread Starter mlcom

    (@mlcom)

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.