Advertisement
Beee

categories-public.php

Oct 9th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.     /*
  3.      * This file is called by templates/forms/location-editor.php to display fields for uploading images on your event form on your website. This does not affect the admin featured image section.
  4.      * Template file for showing categories on event submission form
  5.     */
  6.  
  7.     // event categories
  8.     global $EM_Event;
  9.     $event_categories = EM_Categories::get( array( 'orderby' => 'name', 'hide_empty' => 0 ) );
  10.     if ( count( $event_categories ) > 0 ) : ?>
  11.         <div class="event-categories">
  12.             <h2>Event type</h2>
  13.             <?php foreach( $event_types as $event ) { ?>
  14.                 <div>
  15.                     <label for="event_categories[<?php echo $event->slug; ?>]" class="screen-reader-text"><?php echo $event->name; ?></label>
  16.                     <input name="event_categories[]" id="event_categories[<?php echo $event->slug; ?>]" type="checkbox" value="<?php echo $event->term_id; ?>" /> <?php echo $event->name; ?>
  17.                 </div>
  18.             <?php } ?>
  19.         </div>
  20.     <?php endif;
  21.     unset( $EM_Event );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement