<?php global $post; $startdate = Karma_Events::get_startdate(); $enddate = Karma_Events::get_enddate(); $class = strtolower(date("M", $startdate)); $class .= has_post_thumbnail() ? " img" : ""; $class .= Karma_Events::$hero_slug == $post->post_name ? " hero" : ""; $subscribed = Karma_Subscriber::is_subscribed($post->ID); $subscriber_count = Karma_Subscriber::get_subscriber_count($post->ID); ?> <article id="<?php echo $post->post_name; ?> " class="event event-<?php the_ID(); ?> <?php echo $class; ?> " data-permalink="<?php the_permalink(); ?> "> <header> <?php the_post_thumbnail(); ?> <div class="date"> <div class="startdate"> <div class="month"><?php
public static function render_metadata_form($post) { wp_enqueue_script('karma-events-admin'); wp_nonce_field(self::$nonce_key . '_str', self::$nonce_key); if ($post->post_status !== 'publish') { $subscription_count = Karma_Subscriber::get_subscriber_count(); ?> <small> <strong>Note</strong>: when this event is published, <?php echo $subscription_count == 1 ? "1 subscriber" : $subscription_count . " subscribers"; ?> will be notified via email. </small> <?php } ?> <table class="karma-metadata"> <tr class="karma-startdate"> <th> <label for="karma_metadata_startdate">Start Date</label> </th> <td> <input id="karma_metadata_startdate" type="date" name="<?php echo self::$startdate_key; ?> " value="<?php echo date('Y-m-d', self::get_startdate()); ?> "></input> </td> </tr> <tr class="karma-enddate"> <th> <label for="karma_metadata_enddate">End Date</label> </th> <td> <input id="karma_metadata_enddate" type="date" name="<?php echo self::$enddate_key; ?> " value="<?php echo date('Y-m-d', self::get_enddate()); ?> "></input> </td> </tr> <tr class="karma-contacts"> <th> <label>Links</label> </th> <td class="karma-contacts-list"> <?php $contacts = self::get_contacts($post->ID); if (!empty($contacts)) { foreach ($contacts as $index => $contact) { self::render_contact_block($contact); } } self::render_contact_block(); ?> </td> </tr> </table> <style> .karma-metadata th, .karma-metadata td { display: block; text-align: left; } .karma-metadata input { width: 100%; } .karma-contact input { width: calc(50% - 4px); } </style> <?php }