WordPress.org

Making WordPress.org

Ticket #4864: 4864.diff

File 4864.diff, 1.1 KB (added by valentinbora, 22 months ago)

Add calendar icon linking to Google Calendar event addition

  • wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php
    index 2a6a82c53..05f5634de 100644
     
    4848                        echo '<a href="http://www.timeanddate.com/worldclock/fixedtime.html?iso='.gmdate('Ymd\THi', $time).'"><abbr class="date" title="'.gmdate('c', $time).'">';
    4949                        echo date( 'F j, Y H:i \U\T\C', $time );
    5050                        echo '</abbr></a>';
     51
     52                        echo '&nbsp; <a target="_blank" href="' . add_query_arg( array(
     53                                'action' => 'TEMPLATE',
     54                                'text' => urlencode( sprintf( __( '%s in %s' ), get_the_title(), $post->location ) ),
     55                                'dates' => sprintf( '%s/%s', gmdate( 'Ymd\THis\Z', $time ), gmdate( 'Ymd\THis\Z', $time + HOUR_IN_SECONDS ) ),
     56                                'trp' => 'true',
     57                        ), 'https://www.google.com/calendar/event') . '"><span class="dashicons dashicons-calendar"></span></a>';
    5158                        ?></td>
    5259                        <td><?php echo $post->location; ?></td>
    5360                </tr>