I dont know that exactly do you want to put in dropdown menu. I added input type=”text”, but it would be similar, just need to change input type and display options.
This is how to storage data:
You need to add new field in db, in ‘wp_ai1ec_events’ table, in my case it was ‘website’.
To add new field to class edit:
all-in-one-event-calendar/app/model/class-ai1ec-event.php (line 164) add:
/**
*
* website class variable
*
@var string
**/
var $website;
find (line 295):
// =============================
// = Fetch event from database =
// =============================
$query = $wpdb->prepare(
"SELECT e.post_id, UNIX_TIMESTAMP( e.start ) as start, UNIX_TIMESTAMP( e.end ) as end, e.allday, e.recurrence_rules, e.exception_rules,
e.recurrence_dates, e.exception_dates, e.venue, e.country, e.address, e.city, e.province, e.postal_code,
e.show_map, e.contact_name, e.contact_phone, e.contact_email, e.cost, e.ical_feed_url, e.ical_source_url,
e.ical_organizer, e.ical_contact, e.ical_uid, e.website, " .
"GROUP_CONCAT( ttc.term_id ) AS categories, " .
"GROUP_CONCAT( ttt.term_id ) AS tags " .
and add e.website,
to sql query.
(line 618) add:
// =========================
// = Get website address =
// =========================
case 'website':
return $website = $this->website;
(line 671) add:
'website' => $this->website,
(line 697) add:
'%s'
Edit all-in-one-event-calendar/app/helper/class-ai1ev-calendar-helper.php (line 215) and add in the end of query:
, e.website
(line 319) add to query:
, e.website
Edit all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php (line 579) and add in the end of sql query:
, e.website
Edit all-in-one-event-calendar/app/controller/class-ai1ec-app-controller.php (line 255) add:
website varchar(255),
Edit all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php (line 204) add:
$website = $event->website;
(line 269) add:
'website' => $website,
(line 337) add:
$website = isset( $_POST['ai1ec_website'] ) ? stripslashes( $_POST['ai1ec_website'] ) : '';
(line 456) add:
$event->website = $website;
(line 630) add:
'website' => $event->website
To display input field you need to edit correct file to display it in correct place. I added my field in ‘Organizer contact info’, so i edit app-in-one-event-calendar/app/view/box_event_contact.php (line 34):
<tr>
<td>
<label for="ai1ec_website">
<?php _e( 'Website:', AI1EC_PLUGIN_NAME ); ?>
</label>
</td>
<td>
<input type="text" name="ai1ec_website" id="ai1ec_website" value="<?php echo $website; ?>" />
</td>
</tr>
To display it on website, edit all-in-one-event-calendar/app/view/event-single.php (line 38):
<tr>
<?php if( $website ): ?>
<th scope="row" class="ai1ec-website"><?php _e( 'Website:', AI1EC_PLUGIN_NAME ) ?></th>
<td class="ai1ec-website"><a href="<?php
$url='';
$tmp=explode("/",$website);
if ($tmp[0]=='http:' || $tmp[0]=='https:')
$url .= $website;
else
$url .= 'https://'.$website;
echo $url;
?>" target="_blank"><?php echo $website ?></a></td>
<?php endif ?>
</tr>
my v. plugin is 1.0.9