My Calendar - Version 3.0.17

Version Description

  • Bug fix: Group event editing was broken.
  • Bug fix: Eliminate four PHP notices in the Today's Events widget.
  • Added: Filter to control whether CSS should be loaded on archives.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 3.0.17
Comparing to
See all releases

Code changes from version 3.0.11 to 3.0.17

changelog.txt CHANGED
@@ -1,3 +1,789 @@
1
= 2.2.13 =
2
3
* Bug fix: Threw error if network-activated (wp_is_mobile() not defined yet)
1
+ = 2.5.17 =
2
+
3
+ * Security: Authenticated XSS vulnerability resolved.
4
+ * Remove 'create_function' for PHP 7.2 compatibility.
5
+ * Updated: Upgrade Notice output.
6
+
7
+ = 2.5.16 =
8
+
9
+ * Bug fix: Event deletion action executed when individual instance deleted from front-end
10
+ * Updates: due to esc_sql function changes in WordPress 4.8.3
11
+
12
+ = 2.5.15 =
13
+
14
+ * Bug fix: Jumpbox rendered October as January due to unneeded character replacement
15
+
16
+ = 2.5.14 =
17
+
18
+ * Bug fix: saving setting for main calendar URL from front page doesn't work
19
+ * Bug fix: esc_url only in appropriate places
20
+ * Bug fix: Recognize month parameter from shortcode in navigation elements
21
+ * Bug fix: 404s for deleted events
22
+ * Bug fix: Print styles handle date in week view better
23
+ * Bug fix: Events not visible in list with list JS disabled
24
+ * Bug fix: SQL query for conflict checking threw errors
25
+ * New option: list all events in list view with JS
26
+
27
+ = 2.5.13 =
28
+
29
+ * Bug fix: Categories can not be part of the md5 hash used to identify unique tables (breaks AJAX nav for categories)
30
+ * Bug fix: recurring scheduling for week-days only not functional when 7 days or greater
31
+ * Bug fix: Print view location filters broken
32
+ * Bug fix: Make AJAX scripting aware of which other scripts are enabled.
33
+ * Bug fix: Sort scheduled dates for event by date
34
+ * Bug fix: JetPack Grunion Contact form interfered with TinyMCE in contexts outside of post editor (https://github.com/Automattic/jetpack/issues/7598)
35
+ * Bug fix: ensure date is retained if datepicker disabled
36
+ * Bug fix: archived events filter marked as active when not
37
+
38
+ = 2.5.12 =
39
+
40
+ * Bug fix: missing space in conflict identification
41
+ * Bug fix: internationalization of string to time created conflict when entering month abbreviations
42
+ * Add filter to enable creation of a custom content editor
43
+
44
+ = 2.5.11 =
45
+
46
+ * Bug fix: Bottom mass action buttons outside of form
47
+ * Bug fix: User select form used 'checked' instead of 'selected'
48
+
49
+ = 2.5.10 =
50
+
51
+ * Bug fix: allow parsing of non-English strings through strtotime()
52
+ * Bug fix: trim whitespace off array keys in location controller
53
+ * Bug fix: Don't display 'Add Event' menu in adminbar if remote event database is enabled
54
+ * Bug fix: All day events correctly exported in iCal files
55
+ * Bug fix: Footer navigation not shown on single day view
56
+ * Bug fix: Execute AJAX navigation from both header and footer containers
57
+ * Bug fix: {icon_html} returned broken image if category had no assigned icon
58
+ * Removed obsolete PHP 4 compatibility for clone keyword
59
+ * Added hook to prevent activation if PHP version below 5.3.0.
60
+ * New filter: define custom target calendar URL via 'mc_get_uri' filter
61
+ * New action: 'mc_insert_recurring' run while creating event instances
62
+ * New filter to customize default event length: 'mc_default_event_length'
63
+ * New filter: 'mc_show_week_number' to turn on column indicating displayed week's number. (props Josef Fällman)
64
+ * UI Change: Duplicate navigation and search on events list at bottom of list
65
+ * Miscellaneous improvements to the My Calendar Filters shortcode: set target URL & change location search type, add as widget
66
+ * New widget: My Calendar event filters
67
+ * Added inverse color style declaration to category color template tag
68
+
69
+ = 2.5.9 =
70
+
71
+ * Bug fix: class .mc-main appeared twice in day view
72
+ * Bug fix: iCal output fetches no data on subsites in multisite networks
73
+ * Bug fix: broken image upload script due to localization change
74
+ * Bug fix: sorting events by category should sort by name, not ID
75
+ * Add site name to .ics output file
76
+
77
+ = 2.5.8 =
78
+
79
+ * Bug fix: mc-ajax.js referred to a class that did not always exist
80
+ * Bug fix: Cases missed in interpreting category class values
81
+ * Bug fix: For backwards compatibility, ensure that spaces are replaced with hyphens in category classes
82
+ * Bug fix: Check whether templates returned are empty & ensure fallback renders
83
+ * Bug fix: revise FOUC implementation to avoid jQuery not defined errors
84
+
85
+ = 2.5.7 =
86
+
87
+ * Bug fix: notice in event image field if input disabled
88
+ * Bug fix: class setting was based on GMT timestamp according to MySQL
89
+ * Bug fix: PHP notice thrown if requested template doesn't exist
90
+ * Bug fix: support for embedding videos via iFrame.
91
+ * Bug fix: JS refinements to AJAX loading; changing formats can cause panel closing not to fire due to .list/.calendar switching
92
+ * Bug fix: JS refinements to AJAX loading; make sure everything works when positioned in the header or are excluded
93
+ * Bug fix: always provide a category class that's valid
94
+ * Bug fix: If mini calendar links set to open to new page, automatically disable JS
95
+ * Bug fix: If special options hidden, always set to 'true' on event save.
96
+ * Added: aria-current for current date.
97
+ * Improve KSES implementation
98
+ * Improved URL building
99
+ * Improvements to print CSS
100
+ * Improvements to sortable CSS
101
+ * New filter: 'mc_category_icon'
102
+ * New action: 'mc_print_view_head'
103
+
104
+ = 2.5.6 =
105
+
106
+ * New filter: mc_user_can_see_private_events to change criteria for visibility of private events
107
+ * New filter: mc_private_categories to tweak which categories are considered private
108
+ * Bug fix: PHP warning due to cache query occurring when caching is not enabled
109
+ * Bug fix: images entered only as URLs deleted on edit
110
+ * Accessibility: aria-expanded attached to wrong element in list view
111
+ * Accessibility: ornamental icon fonts exposed to screen readers
112
+
113
+ = 2.5.5 =
114
+
115
+ * Bug fix: notices when generating classes for upcoming events
116
+ * Bug fix: RSS feed should respect private categories
117
+ * Bug fix: Events happening now shortcode should respect private categories
118
+ * Bug fix: iCal output should respect private categories
119
+ * Bug fix: @ suppressed notices in template tag parsing. props @uscore713
120
+ * Bug fix: eliminate two notices in upcoming events class parsing
121
+ * New filter: mc_draw_upcoming_event
122
+ * New filter: mc_draw_todays_event
123
+ * Marked as compatible with 4.7
124
+
125
+ = 2.5.4 =
126
+
127
+ * Add New link on Manage Events screen
128
+ * Add new link on Edit categories screen
129
+ * Add new link on Edit locations screen
130
+ * Changed maxlength on recurrence unit field to 2
131
+ * Eliminate two notices generate on manage events screen
132
+ * Two incorrect method_exists checks; should be property_exists
133
+
134
+ = 2.5.3 =
135
+
136
+ * Bug fix: prevent non-object warning in check for notime text
137
+ * Bug fix: missing classes from some instances of upcoming events list
138
+ * Bug fix: Only show invalid format/time errors if user with permissions.
139
+ * Enhancement: Include invalid format/time in error message.
140
+ * Performance: In single event shortcode, break out of foreach if list of related events not being produced.
141
+
142
+ = 2.5.2 =
143
+
144
+ * Bug fix: Make sure that upcoming events element filters operate in all cases
145
+ * Bug fix: Permit {register} template tag to pass additional attributes
146
+ * Bug fix: Add class to permitted attributes on span tag
147
+
148
+ = 2.5.1 =
149
+
150
+ * Bug fix: Multi-word category titles not hyphenated in event classes
151
+ * Bug fix: Add `{related}` template tag to documentation
152
+ * Bug fix: Today's events template broken
153
+ * Add 'past-event' and 'future-event' classes to related event list & main events lists
154
+
155
+ = 2.5.0 =
156
+
157
+ * Update hcalendar structures
158
+ * Better handling when updating event taxonomies
159
+ * Options to restrict management of events by category / user
160
+ * UI Clean up
161
+ * Don't display format toggle on mobile if automatic format switching enabled
162
+ * Add custom date option to upcoming events shortcode builder
163
+ * Improved error message if user creates event with an invalid recurring cycle
164
+ * Updated template editor; ability to create custom templates.
165
+ * Add option to add new dates for an existing event.
166
+ * For single event, show closest available date if no/invalid date ID provided.
167
+ * Added first occurrence data to core event object
168
+ * New template tag: {related} to list other events in the same group
169
+ * New loading indicator for AJAX navigation
170
+ * New filter to modify event classes
171
+ * New function to generate event classes
172
+ * Reduce number of strings in plug-in to reduce burden on translators
173
+ * Multisite: ability to display calendar for any site on any other site
174
+ * in my_calendar_draw_event(), add filter to hide additional days of events
175
+ * Improved HTML filtering to allow input elements and schema.org attributes.
176
+ * Add support for Google Maps API key field, now required for use of Google Maps on new sites
177
+ * Add 'today' keyword for the upcoming events 'to' attribute
178
+ * Updates to Help documentation
179
+ * Bug fix: auto assign events with no category to 'General'
180
+ * Bug fix: some user select lists overwrote select list options
181
+ * Bug fix: new events with no times entered need to be created as all day events
182
+ * Bug fix: wrong number of arguments passed to mass delete events hook
183
+ * Bug fix: Custom JS incorrectly escaped in Script manager
184
+ * Bug fix: removed numerous notices
185
+ * Bug fix: improved handling of missing event posts
186
+ * Bug fix: allow more HTML elements & attributes
187
+ * Bug fix: misc. notices
188
+
189
+ Breaking Changes:
190
+
191
+ * Breaking change: minor changes to classes to improve structured data in microformats
192
+ * Breaking change: upcoming events widget no longer uses ID 'upcoming-events'; use class '.upcoming-events'
193
+ * Breaking change: today's events widget no longer uses ID 'todays-events'; use class '.todays-events'
194
+
195
+ = 2.4.21 =
196
+
197
+ * Bug fix: Google Maps format change to latitude/longitude links
198
+ * Bug fix: Use short description directly as {excerpt} if provided.
199
+
200
+ = 2.4.20 =
201
+
202
+ * Bug fix: PHP warning triggered on type conversion when toggling time views.
203
+ * Bug fix: Map template tag returned raw scripts without `<script>` tags.
204
+
205
+ = 2.4.19 =
206
+
207
+ * IMPORTANT: SECURITY RELEASE
208
+ * Security fix: XSS vulnerability: user who could create or edit an event could insert a XSS attack.
209
+ * Security fix: Phishing vulnerability: user who could create or edit an event could insert an iFrame for phishing
210
+ * Security fix: Possible to programmatically alter the event being edited to push edits into a different event.
211
+ * Security fix: Possible to programmatically alter the author of the edited event.
212
+
213
+ Other changes in this release:
214
+
215
+ * Screen-reader-text class was duplicated on mini calendar dates
216
+ * New class: 'all-categories' on all categories link
217
+ * New filter: filter All Categories text
218
+ * New filter: filter Map URL & Map Label
219
+ * Bug fix: when sequentially switching from Month to Week to Month & back to Week, Week would revert to first week of month.
220
+ * Bug fix: Maintain current view when switching categories
221
+
222
+ = 2.4.18 =
223
+
224
+ * Add permalink settings notice to field note for clearer instructions.
225
+ * New filter: inner content filter for templates.
226
+ * Improve template handling when partial event passed to template
227
+ * Add filters to alter wrapper elements in Today's Events & Upcoming Events lists.
228
+ * Bug fix: {excerpt} template tag had invalid if/else logic.
229
+ * Remove files for Spanish, French, Polish, Portuguese, Japanese, and Czech translations in favor of language packs
230
+
231
+ = 2.4.17 =
232
+
233
+ * Bug fix: Google Maps calendar ignored Latitude/Longitude.
234
+ * Bug fix: missing ID attribute on form field
235
+ * Bug fix: replace an anchor with a button in admin
236
+ * Bug fix: missing label in manage events
237
+ * Bug fix: missing quote broke id attribute on manage categories
238
+ * Bug fix: duplicate IDs in tab UI structure on Settings page
239
+ * Add support for selective refresh in customizer
240
+ * Updated HTML hierarchy
241
+
242
+ = 2.4.16 =
243
+
244
+ * Minor CSS updates in calendar stylesheets
245
+ * Bug fix in widgets
246
+ * Bug fix in list JS with focus management (accessibility)
247
+
248
+ = 2.4.15 =
249
+
250
+ * Increase field length allowed for event location fields
251
+ * Picker CSS improvements
252
+ * Bug fixes on event search queries
253
+
254
+ = 2.4.14 =
255
+
256
+ * Bug fix: possible SQL error if event ID not saved in event post on event creation.
257
+ * Bug fix: database didn't allow recurring spacing larger than 9; input allowed up to 12.
258
+ * Bug fix: multiple uses of {dtstart format=''} in upcoming events caused repeated data.
259
+ * Bug fix: Escaping of address string in Google Maps
260
+ * Bug fix: Pass parameter to indicate whether calendar is rendered in widget or shortcode. Only render single view in shortcode.
261
+ * Bug fix: Custom stylesheets had to have same names as standard stylesheets
262
+ * Bug fix: Print view return link returns to previous page instead of My Calendar URL.
263
+ * Bug fix: Potential broken image icon in category manager
264
+ * Prep: Eliminate references to add_object_page(), deprecated in 4.5
265
+ * Prep: Eliminate referneces to get_currentuserinfo(), deprecated in 4.5
266
+ * Add Filter: make time interval filterable ('mc_interval')
267
+
268
+ = 2.4.13 =
269
+
270
+ * Allow feeds to show on mini calendar widget
271
+ * Bug fix (performance); only check table type for current table of interest.
272
+ * Bug fix: Allow mini widget calendar title to be blank.
273
+ * Bug fix: Catch some instances where a SQL error could be generated by missing data.
274
+ * Bug fix: Removed i18n of calendar day classes to avoid breaking HTML in non-latin languages. [Potentially breaking change]
275
+ * Bug fix: Improvement to stylesheet notices when file editing disallowed in WordPress
276
+ * Bug fix: Notice could be thrown if template parts not all set.
277
+ * Removed: Deprecated remaining parts of the migration path from 1.7.0 and earlier.
278
+ * Revalidate RSS feed
279
+ * Add filter to enable alerts on ical events.
280
+
281
+ = 2.4.12 =
282
+
283
+ * Bug fix: allow / character in permalink formats
284
+ * Bug fix: missing reference in CSS for Google Maps images
285
+ * Bug fix: Single event delete broken
286
+ * Bug fix: if event deleted from Manage Events screen, stay on Manage Events instead of shifting to Add New.
287
+ * Bug fix: Improper i18n in events list heading
288
+
289
+ = 2.4.11 =
290
+
291
+ * Bug fix: remove category parameter from 'All Categories'
292
+ * Bug fix: Invalid closing </th>
293
+ * Bug fix: Update gmap3 to version 6.0
294
+ * Bug fix: CSS conflict with max-width can cause Google Maps image to fail to render correctly.
295
+ * Bug fix: duplicate ID in list view breaking layout.
296
+ * I18n fix: Make accessibility strings translatable without requiring filters
297
+ * Change: Open list panels with a button.
298
+ * Update: Rewrote mc-list.js
299
+
300
+ = 2.4.10 =
301
+
302
+ * Bug fix: Better detection of whether or not multisite support is available.
303
+ * Bug fix: Stop disabling JS on mobile if format conversion is enabled.
304
+ * Bug fix: Pretty permalinks display of event date/time broken on recurring events.
305
+ * Bug fix: Handle use of using_index_permalinks() and produce correct URLs.
306
+ * New filter: 'mc_use_custom_template': pass a file name or template name to use a custom template for a given event display.
307
+ * Language updates: French, Russian, Catalan, Italian
308
+
309
+ = 2.4.9 =
310
+
311
+ * Bug fix: Make iCal support elimination of holiday collisions
312
+ * Bug fix: Compensate for other plug-ins defining their own tab styles on My Calendar's settings
313
+ * Bug fix: Fallback to My Calendar DB images if featured images missing on post.
314
+ * Add support: Search events without requiring MyISAM MySQL engine.
315
+ * Language updates: Portuguese (Brazil), German
316
+
317
+ = 2.4.8 =
318
+
319
+ * Bug fix: Md5 hash on arguments includes format & timeframe, so switching between options broke CID references
320
+ * Bug fix: clear undefined index notice occurring only under specific unusual server configurations
321
+
322
+ = 2.4.7 =
323
+
324
+ * Update Italian translation
325
+ * Bug fix: Ensure that mini calendar widgets have unique IDs
326
+ * Eliminate an obsolete variable.
327
+
328
+ = 2.4.6 =
329
+
330
+ * Bug fix: I just can't stop making stupid mistakes in print view. Sheesh.
331
+
332
+ = 2.4.5 =
333
+
334
+ * Mislabeled form field on date switcher.
335
+ * Add primary sort filter to main event function [props @ryanschweitzer]
336
+ * New filters on navigation tools.
337
+ * Bug fix: Print view loaded when iCal requested [broken in 2.4.4]
338
+ * Bug fix: Changes to Upcoming Events widget to better limit upcoming events lists.
339
+ * Language updates: Czech, Swedish, Finnish
340
+
341
+ = 2.4.4 =
342
+
343
+ * Bug fix: Stray character return in Print view
344
+ * Bug fix: Print view did not respect date changes
345
+ * Bug fix: Logic error in sort direction switching in admin when setting not configured
346
+ * Change: Print view no longer driven by feed API.
347
+ * Change: Added option to disable "More" link from settings
348
+
349
+ = 2.4.3 =
350
+
351
+ * Bug fix: reversed filter name/value pairing in SQL query.
352
+
353
+ = 2.4.2 =
354
+
355
+ * Bug fix: in Upcoming Events shortcode (mismatch between documentation & reality).
356
+
357
+ = 2.4.1 =
358
+
359
+ * Bug fix: Missing style in print.css
360
+ * Bug fix: Broken <head> in print view.
361
+
362
+ = 2.4.0 =
363
+
364
+ New features:
365
+
366
+ * Set upcoming event class based on time, rather than date.
367
+ * Add past/present classes to today's events widget
368
+ * Assign Custom All Day label for each event.
369
+ * Support hiding 'Host' field as option.
370
+ * Made primary sort order of events filterable: 'mc_primary_sort'
371
+ * Added action to location saving handling updated locations
372
+ * Added arguments to from/to filters in Upcoming Events
373
+ * Enabled option to turn on permalinks
374
+ * Custom canonical URL for event pages
375
+ * Added 'date' parameter to today's events list & shortcode accepting any string usable in strtotime()
376
+ * Added 'from' and 'to' parameter to upcoming events list & shortcode accepting any string usable in strtotime
377
+ * Added year/month/day parameter to main shortcode to target specific months for initial display.
378
+ * Make BCC field filterable
379
+ * Add filters to search query parameters
380
+ * New option: switch to mini calendar on mobile devices instead of list view.
381
+ * Add [day] select field to date switcher if in 'day' view.
382
+ * Option to set default sort direction
383
+ * Ability to set three separate event title templates: grid, list, and single.
384
+ * Added admin-bar link to view calendar.
385
+ * Added option to customize permalink slug on permalink page
386
+ * Single event pages as permalinks use the same template as main if custom template isn't enabled.
387
+ * New template tag: {color_css} and {close_color_css} to wrap a block with the category background color.
388
+ * Add category classes to Upcoming & Today's events widgets
389
+ * Redirect page to main calendar if event is private
390
+ * Improved labeling of cell dates
391
+
392
+ Bug fixes:
393
+
394
+ * Stop setting all day events to end at midnight; use 11:59:59 and filter output
395
+ * Rewrite iCal output so that the iCal download eliminates Holiday cancellations
396
+ * Bug fix: Prevent extraneous variables from leaking into the navigation output.
397
+ * Rendering post template in permalinks only applies within Loop.
398
+ * Template attribute preg_match could only pick up 2 parameters
399
+ * Prevent an invalid mc_id value from returning errors.
400
+ * Prevent deprecation notice when getting text_direction
401
+ * Default to not showing navigation options in print view.
402
+ * Better loading of text domain.
403
+ * Prevent mini calendar from switching to list format.
404
+ * Change class construction to PHP 5 syntax
405
+ * Close button is now a button rather than a link.
406
+ * Fixed display of text diff for stylesheet comparisons
407
+ * Two different filters with different names.
408
+ * mc_after_event filter not running with custom templates.
409
+ * With My Tickets active, enter key did not submit Add/Edit event form
410
+ * Fixed documentation error with ical template tags.
411
+ * Improved efficiency of WP shortcode processing in templates.
412
+ * A multi-day event crossing the current day was counted as a future event in upcoming events
413
+ * If event instance was split from recurring event, showed same recurring settings as original event.
414
+ * If events were mass deleted, the corresponding event post was not also deleted.
415
+ * Prevent single event pages from displaying content if the event is in a private category.
416
+
417
+ Important Changes:
418
+
419
+ * Removed references to #jd_calendar and generate custom IDs. [breaking change
420
+ * Revision of settings page [reorganize settings into tabs]
421
+ * Reorganized settings pages.
422
+
423
+ Other:
424
+
425
+ * Moved changelog for versions prior to 2.3.0 into changelog.txt
426
+
427
+ Translations:
428
+
429
+ * Updated Polish, Portuguese (Portugal), Dutch, Turkish, Slovak, Norwegian, Hungarian, German, Spanish, Persian, Czech, Danish
430
+
431
+ = 2.3.32 =
432
+
433
+ * Bug fix: end time for events auto-toggled to midnight, instead of +1 hour when end time omitted.
434
+
435
+ = 2.3.31 =
436
+
437
+ * Added escaping in 2.3.30 broke location & category limits (escape placed on wrong string.)
438
+
439
+ = 2.3.30 =
440
+
441
+ * Security Fix: Arbitrary File Override
442
+ * Security Fix: Reflected XSS
443
+ * Thanks for Tim Coen for responsibly disclosing these issues.
444
+ * All issues apply for authenticated users with access to My Calendar settings pages.
445
+ * Language updates: Updated Polish, Swedish, Galician, Czech, Norwegian, Italian
446
+ * Added Slovak, Icelandic, Hebrew
447
+
448
+ = 2.3.29 =
449
+
450
+ * Security Fix: XSS issue applying to improper use of add_query_arg(). See https://yoast.com/tools/wrong-use-of-add_query_arg-and-remove_query_arg-causing-xss/
451
+
452
+ = 2.3.28 =
453
+
454
+ * Bug fix: Problem saving My Calendar URI if My Calendar is intended for use behind a secured location.
455
+ * Update languages: French, German, Catalan
456
+
457
+ = 2.3.27 =
458
+
459
+ * Bug fix: Things that happen when you failed to write down a minor change - you don't test it. Couldn't choose a preset location when creating an event in 2.3.26.
460
+
461
+ = 2.3.26 =
462
+
463
+ * Typo in aria-labelledby.
464
+ * Bug fix: fatal error if wp_remote returns WP_error.
465
+ * Bug fix: could not set calendar URI if site is password protected.
466
+ * Bug fix: category key fetched icons using a different path generation than main calendar that could result in a broken link.
467
+ * Bug fix: ensure that all image template tags exist in the array, even if the event post does not exist.
468
+ * Bug fix: make print view respect current category/location filters
469
+ * Bug fix: make iCal download respect current category/location filters
470
+ * Added class on event data container for root ID of events.
471
+ * Added 'current' class for currently selected category in category key if category filter applied.
472
+
473
+ = 2.3.25 =
474
+
475
+ * Bug fix: Escape URL for search form request URL
476
+ * Bug fix in check whether event had a valid post container.
477
+ * Bug fix to handle problem with weeks calculation on the first of the month.
478
+ * Bug fix: Display problem in single-page event view in twentyfifteen.css
479
+ * Bug fix: If My Calendar URL is invalid, re-check when settings page is loaded.
480
+ * Bug fix: Don't display update notice on new installs.
481
+ * Change: My Calendar automatically generates calendar page on installation.
482
+ * Change to Upcoming Events default template to make usage more robust.
483
+ * Change: mc-mini JS to auto close all open panels if a new one is opened.
484
+ * Rearrange a few settings for better usability.
485
+ * Added ability to use Upcoming Events widget to show the nth future month. (e.g., show events for the 6th month out from today.)
486
+ * Deprecated upgrade cycles prior to version 1.11.0.
487
+ * Improve accessibility of tab panels used in My Calendar UI.
488
+ * Language updates: Updated Russian, Added Afrikaans
489
+
490
+ = 2.3.24 =
491
+
492
+ * Bug fix: In mini widget, date is not displayed if only event on date is private
493
+ * Bug fix: Improved fix to year rendering (roughly fixed in 2.3.23)
494
+ * Bug fix: Improved rendering of structured event data.
495
+ * Bug fix: [my_calendar_now] incorrectly checked the current time.
496
+ * Bug fix: "Archive" link pointed to wrong location in event manager.
497
+ * Bug fix: Was no way to reverse archiving an event; added method
498
+ * Bug fix: Shortcode generator produced incorrect Upcoming Events shortcode.
499
+ * Bug fix: Overlapping occurrences warning inappropriately showed on events recurring on a month by day basis
500
+ * Bug fix: If only event on date is private, don't add class 'has-events'
501
+ * Bug fix: Save default values for top/bottom nav on install.
502
+ * Bug fix: Restore default template array when plug-in is deleted and re-installed
503
+ * Minor style change to twentyfourteen.css
504
+ * New default theme: twentyfifteen.css
505
+ * Feature add: AJAX control to delete individual instances of a recurring event from the event editor.
506
+ * Feature change: Events post type content filter now replaces content instead of repeating. Use 'mc_event_content' filter to override.
507
+ * Improvement: Show overlapping occurrences warnings in manage events view.
508
+ * Improvement: List/Grid button only shows on month and week views.
509
+ * Misc. UI improvements.
510
+ * Performance fix: Hide overlapping recurring events on front-end. (They can consume massive amounts of memory.)
511
+ * Language updates: French, Spanish, Japanese, Dutch, German, Ukrainian, Swedish
512
+
513
+ ISSUE: What's causing templates to not be set?
514
+
515
+ = 2.3.23 =
516
+
517
+ * Bug fix: Calendar rendering 2014 at beginning of 2015.
518
+ * Bug fix: Set Holiday category when adding new categories.
519
+ * Bug fix: Search widget title heading HTML not rendered.
520
+ * Bug fix: mc-ajax.js was not compatible with heading filter for output.
521
+ * Language updates: French, Spanish, Ukrainian
522
+
523
+ = 2.3.22 =
524
+
525
+ * Edit: Allow integers up to 12 in the 'every' field for recurring events. (Previously 9)
526
+ * Bug fix: Incorrect sprintf call in {recurs} template, effecting recurring events by month.
527
+ * Language updates: German, Russian, Portuguese (Portugal), Hungarian, Ukrainian
528
+
529
+ = 2.3.21 =
530
+
531
+ * Plug-in conflict fix: CSS override to fix conflict with Ultimate Social Media Icons
532
+ * Bug fix: Allow {image_url} to fall back to thumbnail size if no medium / create _url equivalents for each size.
533
+ * Bug fix: Allow location controls to be entered with only keys.
534
+ * Bug fix: Entering default value for controlled locations is empty value, instead of 'none'.
535
+ * Bug fix: If value of location field is 'none', don't display.
536
+ * Bug fix: Use Location URL as map link if URL is provided and no other mappable location information
537
+ * Bug fix: if editing single instance, delete link will delete just that instance.
538
+ * Bug fix: If recurring event fields were hidden, but event recurred, recurrences would be deleted.
539
+ * Bug fix: Limiting locations did not work in Upcoming Events using 'events' mode.
540
+ * Bug fix: Allow limiting locations but all event location fields.
541
+ * Bug fix: Limiting locations accepts numeric values for limiting.
542
+ * Bug fix: {recurs} template tag indicates frequency ("Weekly", vs "every 3 weeks")
543
+ * Bug fix: fixed templating issue when custom templates used a tag multiple times with different attribute parameters.
544
+ * Add filter to modify the title information shown in list view to hint at hidden events ('mc_list_event_title_hint')
545
+ * Add filter: number of months shown in list view filterable on 'mc_show_months'
546
+ * Feature: Add shortcode/function to display a current event. [my_calendar_now]
547
+ * Feature: Add search results page option to calendar search widget.
548
+ * Removed all remaining code related to user settings, which are no longer in use.
549
+ * Language updates: French, Danish, Russian, Swedish, Portuguese/Brazil, Portuguese/Portugal, Norwegian Bokmal, Hungarian
550
+
551
+ = 2.3.20 =
552
+
553
+ * Bug fix: Escaped $ variable in custom JS wrapper
554
+ * Bug fix: has-events class appearing in calendar on days after all-day events
555
+ * Bug fix: Reset stylesheet applied outside calendar HTML. Eliminated elements not used by MC.
556
+ * Bug fix: Missing required argument for My Calendar search form widget
557
+ * Bug fix: 'Approve' link broken
558
+ * Bug fix: Details link could return expired event links.
559
+ * Translation updates: Spanish, Slovenian
560
+
561
+ = 2.3.19 =
562
+
563
+ * Bug fix: Could not un-check show today's events in Upcoming Events widget
564
+ * Bug fix: Could not turn off event recurrences section in event manager
565
+ * Bug fix: stripped HTML tags out of upcoming events & today's events template fields
566
+
567
+ = 2.3.18 =
568
+
569
+ * Bug in rendering of custom JS causing visible rendering of code.
570
+ * Bug in saving Today's Events widget settings
571
+
572
+ = 2.3.17 =
573
+
574
+ * 2.3.16 bug fix was incomplete, triggered new error. Sorry for rushing!
575
+
576
+ = 2.3.16 =
577
+
578
+ * Bug fix: Upcoming events did not show for logged-in users if site did not have private categories defined.
579
+ * Cleared a PHP notice.
580
+
581
+ = 2.3.15 =
582
+
583
+ * Bug fix: Controlled locations not input correctly from Add Event form
584
+ * Bug fix: Use force_balance_tags() when saving descriptions & short descriptions to prevent descriptions from breaking layout
585
+ * Bug fix: My Calendar reset stylesheet missing .mc-main on buttons; causing display issues with submit buttons.
586
+ * Bug fix: shortcode generator produced results in disabled form field; changed to readonly because Firefox does not permit selecting text in disabled fields.
587
+ * Bug fix: Widget navigation automatically reset itself if you saved widget form after clearing data
588
+ * Bug fix: category classes for multi-day, all-day events showed on termination date
589
+ * Bug fix: Checkbox states on JS scripts not retained
590
+ * Bug fix: Show default values in upcoming events widget
591
+ * Bug fix: Default values not saved on new installation
592
+ * Bug fix: Admin event manager should sort by Date/Time instead of Date/Title
593
+ * Documented [my_calendar_search] shortcode
594
+ * Added 'current' option for author/host to shortcode generator.
595
+ * Extensive code clean up
596
+ * Feature: Default view next month option in calendar and upcoming events lists.
597
+ * Deprecated upgrade cycles prior to version 1.10.0.
598
+ * Language updates: Japanese, Dutch, Italian, Spanish, Finnish, Swedish, Norwegian
599
+
600
+ = 2.3.14 =
601
+
602
+ * Bug fix: Disabled front-end event editing links for logged-in users.
603
+ * Language updates: Spanish, Norwegian, Hungarian
604
+
605
+ = 2.3.13 =
606
+
607
+ * Bug fix: Failed to handle "open links to event details" option in updated JS handling.
608
+
609
+ = 2.3.12 =
610
+
611
+ * Bug fix: change of option name meant that you couldn't enable/disable scripts.
612
+ * Bug fix: shortcode generator generates a 'readonly' textarea instead of disabled so it can be copied in Firefox.
613
+ * Accessibility: handle assignment of focus on AJAX navigation
614
+
615
+ = 2.3.11 =
616
+
617
+ * Change: Modified default JS saving so that only custom JS gets handled in editor.
618
+ * Change: toggle to enable/disable custom JS; default to off
619
+ * Change: Moved scripting into files.
620
+ * Notice: admin notice to inform users of need to activate JS if using custom
621
+ * Bug fix: Modify default JS so wpautop doesn't cause problems with toggles.
622
+ * Bug fix: External links displaying is_external boolean instead of classes.
623
+ * Bug fix: mysql error if location_type not defined but location_value is.
624
+ * Bug fix: page_id unset when default permalinks in use. [Ick. Don't use default permalinks.]
625
+ * Bug fix: My Calendar navigation panel could not disable top/bottom navigation.
626
+ * Feature: * Add Bcc notification list
627
+ * Accessibility: improvements to pop-up event details: focus & closing, ARIA
628
+ * Filter: headers filter for My Calendar email notifications.
629
+ * Filter: Add detection to pass custom JS from custom directory/theme directory
630
+ * Updated French, Spanish translations.
631
+ * Removed .po files from repository; reduces file size by over 2 MB.
632
+
633
+ = 2.3.10 =
634
+
635
+ * New filter: mc_jumpbox_future_years - alter the number of years into the future shown in the calendar date switcher.
636
+ * New filter: mc_add_events_url - alter URL for Add Events in adminbar; return URL
637
+ * New filter: mc_locate_events_page: alter menu parent of Add Events in admin menu; return menu slug or null
638
+ * Bug fix: ltype and lvalue not passed from shortcode into handler for upcoming events.
639
+ * Bug fix: disable comments by default for event post storage.
640
+ * Bug fix: misnamed variable in filter; resolves notice on line 239 of my-calendar-output.php
641
+ * Bug fix: do search and replace on default scripting as well when script fields are blank
642
+ * Bug fix: Check default option for import data from remote database; verify the default will be false
643
+ * Added template tag: {linking_title}; same as {link_title}, but falls back to details link if no URL input for event.
644
+ * Change default widget template to use {linking_title}.
645
+ * Security: Two XSS vulnerabilities fixed. Thanks <a href="http://www.timhurley.net/">Tim Hurley</a>
646
+ * Update Translation: Russian
647
+
648
+ = 2.3.9 =
649
+
650
+ * Bug fix: Minor event templates ( title, detail, etc. ) were not properly escaped in admin forms.
651
+ * Bug fix: use reply-to email header in support messages
652
+ * Bug fix: Mass approval of pending events broken.
653
+ * Bug fix: {linking} template tag referenced wrong event URL.
654
+ * Bug fix: My Calendar API RSS no longer dependent on default RSS data.
655
+ * Bug fix: Replace mysql_* functions for PHP 5.5 compatibility.
656
+ * Bug fix: Incorrect template tag in Single view template: {gcal} instead of {gcal_link}
657
+ * Bug fix: PHP notice on $map
658
+ * Language updates: Japanese, German, Italian
659
+
660
+ = 2.3.8 =
661
+
662
+ * Added {link_image} to add an image linked to the event URL in templates.
663
+ * Bug fix: extended caption value saved but not shown.
664
+ * Bug fix: For multi-day events ending at midnight, last date automatically extended one day at save.
665
+ * Bug fix: on copy, if start date is changed, but end date isn't, increment end date to match length of original event.
666
+ * Change: Eliminate error on empty title fields or invalid recurrence values. Set to default value instead.
667
+
668
+ = 2.3.7 =
669
+
670
+ * Did not enqueue jQuery on front-end unless Google Maps was enabled. (Incorrect condition nesting...) Whoops.
671
+
672
+ = 2.3.6 =
673
+
674
+ * Error in yesterday's bug fix for upcoming events.
675
+ * Bug fix: Email notifications broken.
676
+
677
+ = 2.3.5 =
678
+
679
+ * Bug fix: Notice in today's events widget
680
+ * Bug fix: Images from pre 2.3.0 configuration did not display in default Single event view.
681
+ * Bug fix: Upcoming events list could return too few events.
682
+ * Bug fix: Display default date format if format not set.
683
+ * Bug fix: Fallback to default JS if custom JS not defined.
684
+ * Filter: added filter to Google Maps code; mc_gmap_html
685
+ * Option: enabled option to disable Google Maps output.
686
+
687
+ = 2.3.4 =
688
+
689
+ * Bug fix: Week date format wouldn't save.
690
+ * Bug fix: Event posts & custom field data not saved on copy action
691
+ * Bug fix: HTML errors in {hcard} address format.
692
+ * Bug fix: Manage events search form overlapped pagination links
693
+ * Bug fix: Events ending at midnight in Today's Events lists appeared twice
694
+
695
+ = 2.3.3 =
696
+
697
+ * Bug fix: Notice on access_options filter.
698
+ * Bug fix: Invalid date values if no parameters set for iCal
699
+ * Bug fix: Invalid nonce check in location entry prevented creation of new locations. One missing exclamation point. Sigh.
700
+ * Bug fix: If location controls are on, allow old values to be saved, but raise notice that value is not part of controlled set.
701
+ * Feature: add sync=true to root iCal URL to connect apps for scheduled syncing. (http://example.com/feeds/my-calendar-ics/?sync=true)
702
+ * Updated: Polish translation
703
+
704
+ = 2.3.2 =
705
+
706
+ * Bug fix: label change to clarify entry format for location controls
707
+ * Bug fix: Missing end tag on <time> element
708
+ * Bug fix: my_calendar_search_title can handle missing 2nd argument
709
+ * Bug fix: Add "active" class span on time toggle active case.
710
+ * Bug fix: Recurring all-day events showing twice
711
+ * Bug fix: Non-editable fields for date/time input broke occurrences & restricted time options
712
+ * Bug fix: Category filtering broken when holiday categories enabled
713
+ * Bug fix: Double check whether categories exist and throw error if not, after attempting to create default category.
714
+ * Feature: Mass delete locations
715
+
716
+ = 2.3.1 =
717
+
718
+ * Bug fix: PHP warning on event save
719
+ * Bug fix: PHP Notices generated on deleted author/host value.
720
+ * Bug fix: Pop-up calendar for date entry had incorrect day labels
721
+ * Bug fix: Editing individual date instances issues.
722
+ * Bug fix: {image} fallback for pre 2.3.0 uploaded images
723
+ * Added: secondary sort filter for main calendar views; default event_title ASC. Field and direction must be provided to change.
724
+ * Updated my-calendar.pot
725
+
726
+ = 2.3.0 =
727
+
728
+ This is a major revision.
729
+
730
+ * Bug fix: Manage events screen showed no data for users without manage_events permissions.
731
+ * Bug fix: if single event set, could not filter to time period views.
732
+ * Bug fix: 'single' template ID not passed into template filter.
733
+ * Bug fix: events in private categories appeared in time-based upcoming events lists.
734
+ * Bug fix: RSS feed encoding.
735
+ * Bug fix: Turn-of-year issues with week view.
736
+ * Bug fix: Added new locations multiple times if added with multiple occurrences of an event.
737
+ * Bug fix: In some browsers, time selector added invalid data.
738
+ * Bug fix: List of search results not wrapped in a list element.
739
+ * Bug fix: Trim spaces on above/below navigation strings.
740
+ * Bug fix: If an event ends at midnight, automatically end tomorrow unless set for a later date.
741
+ * Bug fix: Don't show events on both days if they end at midnight.
742
+ * Bug fix: Don't attempt to enqueue jquery.charcount.js if WP to Twitter not installed.
743
+ * Bug fix: Dates didn't strip links in list view when JS disabled for that view.
744
+
745
+ * New template tag: {runtime} to show human language version of length of event.
746
+ * New template tag: {excerpt} to create autoexcerpt from description field, using shortdesc if it exists.
747
+
748
+ * New feature: Accessibility features for locations.
749
+ * New feature: Specify accessibility services for events.
750
+ * New feature: ticketing link field
751
+ * New feature: event registration information fields
752
+ * New feature: my_calendar_event shortcode can query templates by keyword (list,mini,single,grid).
753
+ * New feature: filter events by available accessibility services
754
+ * New feature: Combined filter shortcode to group all filters into a single form. [mc_filters show='locations,categories,access']
755
+ * New feature: new API for adding custom fields to events.
756
+ * New feature: data API to fetch event data in JSON, CSV, or RSS formats.
757
+ * New feature: Archive events to hide from admin events list.
758
+ * New feature: Control input options for multiple types of location input data.
759
+ * New feature: Shortcode generator for primary, upcoming, and today's events shortcodes.
760
+ * New feature: admin-side event search
761
+ * New feature: category key now acts as quick links to filter by category
762
+ * New feature: Option to add title to Event Search widget.
763
+
764
+ * New filter: mc_date_format for customizing date formats.
765
+ * New filter: customize search results page: mc_search_page
766
+ * New filter: mc_use_permalinks to enable use of custom post type permalinks for single event pages.
767
+ * New filter: mc_post_template to customize template used in single event shortcode automatically inserted into custom post type pages.
768
+
769
+ * New design: new stylesheet available: twentyfourteen.css
770
+
771
+ * Updated: added more fields to search on events.
772
+ * Updated: updated image uploader to use add media panel and store attachment ID
773
+ * Updated: <title> template supports all template tags (but strips HTML.).
774
+ * Updated: Various aspects of UI
775
+ * Updated: Date/time selectors. See http://amsul.ca/pickadate.js/, MIT license.
776
+
777
+ * Reorganized default output template code.
778
+ * Import all used locations into location manager.
779
+ * Removed User settings fields.
780
+ * Moved Holiday category assignment to Category Manager.
781
+ * Improved get current URL function.
782
+ * iCal output in multiple-month view outputs all displayed months.
783
+ * {map} template tag to display a Google Map using the Google Maps API. (Not available in pop-up displays.)
784
+ * Scheduled removal of showkey, shownav, toggle, and showjump shortcode attributes.
785
+ * Removed upgrade support for 1.6.x & 1.7.x series of My Calendar.
786
+
787
= 2.2.13 =
788
789
* Bug fix: Threw error if network-activated (wp_is_mobile() not defined yet)
includes/widgets/class-my-calendar-today-widget.php CHANGED
@@ -50,11 +50,15 @@ class My_Calendar_Today_Widget extends WP_Widget {
50
$after_widget = $args['after_widget'];
51
$before_title = $args['before_title'];
52
$after_title = $args['after_title'];
53
54
- $the_title = apply_filters( 'widget_title', $instance['my_calendar_today_title'], $instance, $args );
55
- $the_template = $instance['my_calendar_today_template'];
56
- $the_substitute = $instance['my_calendar_no_events_text'];
57
- $the_category = ( '' == $instance['my_calendar_today_category'] ) ? 'default' : esc_attr( $instance['my_calendar_today_category'] );
58
$author = ( ! isset( $instance['my_calendar_today_author'] ) || '' == $instance['my_calendar_today_author'] ) ? 'all' : esc_attr( $instance['my_calendar_today_author'] );
59
$host = ( ! isset( $instance['mc_host'] ) || '' == $instance['mc_host'] ) ? 'all' : esc_attr( $instance['mc_host'] );
60
$default_link = mc_get_uri( false, $args );
50
$after_widget = $args['after_widget'];
51
$before_title = $args['before_title'];
52
$after_title = $args['after_title'];
53
+ $today_title = isset( $instance['my_calendar_today_title'] ) ? $instance['my_calendar_today_title'] : '';
54
+ $template = isset( $instance['my_calendar_today_template'] ) ? $instance['my_calendar_today_template'] : '';
55
+ $no_events = isset( $instance['my_calendar_no_events_text'] ) ? $instance['my_calendar_no_events_text'] : '';
56
+ $category = isset( $instance['my_calendar_today_category'] ) ? $instance['my_calendar_today_category'] : '';
57
58
+ $the_title = apply_filters( 'widget_title', $today_title, $instance, $args );
59
+ $the_template = $template;
60
+ $the_substitute = $no_events;
61
+ $the_category = ( '' == $category ) ? 'default' : esc_attr( $instance['my_calendar_today_category'] );
62
$author = ( ! isset( $instance['my_calendar_today_author'] ) || '' == $instance['my_calendar_today_author'] ) ? 'all' : esc_attr( $instance['my_calendar_today_author'] );
63
$host = ( ! isset( $instance['mc_host'] ) || '' == $instance['mc_host'] ) ? 'all' : esc_attr( $instance['mc_host'] );
64
$default_link = mc_get_uri( false, $args );
js/mc-ajax.js CHANGED
@@ -1,15 +1,15 @@
1
(function ($) {
2
- 'use strict';
3
- $(function () {
4
- $(document).on('click', ".my-calendar-header a.mcajax, .my-calendar-footer a.mcajax", function (e) {
5
e.preventDefault();
6
var calendar = $( this ).closest( '.mc-main' );
7
var ref = calendar.attr('id');
8
- var link = $(this).attr('href');
9
var height = $('.mc-main' ).height();
10
- $('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
11
- $('#' + ref).load(link + ' #' + ref + ' > *', function ( response, status, xhr ) {
12
-
13
if ( status == 'error' ) {
14
$( '#' + ref ).html( msg + xhr.status + " " + xhr.statusText );
15
}
@@ -28,9 +28,9 @@
28
$('.mini .has-events').children().not('.trigger, .mc-date, .event-date').hide();
29
}
30
// All views.
31
- $( '#' + ref ).attr('tabindex', '-1').focus();
32
// Your Custom ajax load changes if needed.
33
- });
34
- });
35
- });
36
}(jQuery));
1
(function ($) {
2
+ 'use strict';
3
+ $(function () {
4
+ $(document).on('click', ".my-calendar-header a.mcajax, .my-calendar-footer a.mcajax", function (e) {
5
e.preventDefault();
6
var calendar = $( this ).closest( '.mc-main' );
7
var ref = calendar.attr('id');
8
+ var link = $(this).attr('href');
9
var height = $('.mc-main' ).height();
10
+ $('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
11
+ $('#' + ref).load(link + ' #' + ref + ' > *', function ( response, status, xhr ) {
12
+
13
if ( status == 'error' ) {
14
$( '#' + ref ).html( msg + xhr.status + " " + xhr.statusText );
15
}
28
$('.mini .has-events').children().not('.trigger, .mc-date, .event-date').hide();
29
}
30
// All views.
31
+ $( '#' + ref ).attr('tabindex', '-1').focus();
32
// Your Custom ajax load changes if needed.
33
+ });
34
+ });
35
+ });
36
}(jQuery));
js/mc-datepicker.js CHANGED
@@ -19,7 +19,7 @@ if ( typeof(mc_months) !== "undefined" ) {
19
$( '.mc-timepicker' ).pickatime({
20
interval: parseInt( mc_interval ),
21
format: mc_time_format,
22
- editable: true
23
});
24
25
var begin = $( '#mc_event_date' ).pickadate( 'picker' );
19
$( '.mc-timepicker' ).pickatime({
20
interval: parseInt( mc_interval ),
21
format: mc_time_format,
22
+ editable: true
23
});
24
25
var begin = $( '#mc_event_date' ).pickadate( 'picker' );
js/mc-grid.js CHANGED
@@ -1,33 +1,33 @@
1
(function ($) {
2
- 'use strict';
3
- $(function () {
4
- $(".calendar-event").children().not(".event-title").hide();
5
-
6
- $(document).on("click", ".calendar-event .event-title",
7
- function (e) {
8
- e.preventDefault();
9
- var current_date = $(this).parent().children();
10
11
- $(this).closest( '.mc-main' ).toggleClass( 'grid-open' );
12
- $(this).parent().children().not(".event-title").toggle().attr("tabindex", "-1");
13
$(this).parent().focus();
14
-
15
var focusable = current_date.find( 'a, object, :input, iframe, [tabindex]' );
16
var lastFocus = focusable.last();
17
var firstFocus = focusable.first();
18
lastFocus.attr( 'data-action', 'shiftback' );
19
-
20
$(".calendar-event").children().not(".event-title").not( current_date ).hide();
21
- });
22
-
23
- $(document).on("click", ".calendar-event .close",
24
- function (e) {
25
- e.preventDefault();
26
$(this).closest( '.mc-main' ).removeClass( 'grid-open' );
27
- $(this).closest(".vevent").find(".event-title a").focus();
28
- $(this).closest("div.details").toggle();
29
- });
30
-
31
$(document).on( 'keydown', function(e) {
32
var keycode = ( e.keyCode ? e.keyCode : e.which );
33
if ( keycode == 27 ) {
@@ -35,8 +35,8 @@
35
$( '.calendar-event div.details' ).hide();
36
}
37
});
38
-
39
- $(document).on( 'keydown', '.details a, .details object, .details :input, .details iframe, .details [tabindex]',
40
function(e) {
41
var keycode = ( e.keyCode ? e.keyCode : e.which );
42
var action = $( ':focus' ).attr( 'data-action' );
@@ -47,7 +47,7 @@
47
if ( ( e.shiftKey && keycode == 9 ) && action == 'shiftforward' ) {
48
e.preventDefault();
49
$( '[data-action=shiftback]' ).focus();
50
- }
51
});
52
- });
53
- }(jQuery));
1
(function ($) {
2
+ 'use strict';
3
+ $(function () {
4
+ $(".calendar-event").children().not(".event-title").hide();
5
6
+ $(document).on("click", ".calendar-event .event-title",
7
+ function (e) {
8
+ e.preventDefault();
9
+ var current_date = $(this).parent().children();
10
+
11
+ $(this).closest( '.mc-main' ).toggleClass( 'grid-open' );
12
+ $(this).parent().children().not(".event-title").toggle().attr("tabindex", "-1");
13
$(this).parent().focus();
14
+
15
var focusable = current_date.find( 'a, object, :input, iframe, [tabindex]' );
16
var lastFocus = focusable.last();
17
var firstFocus = focusable.first();
18
lastFocus.attr( 'data-action', 'shiftback' );
19
+
20
$(".calendar-event").children().not(".event-title").not( current_date ).hide();
21
+ });
22
+
23
+ $(document).on("click", ".calendar-event .close",
24
+ function (e) {
25
+ e.preventDefault();
26
$(this).closest( '.mc-main' ).removeClass( 'grid-open' );
27
+ $(this).closest(".vevent").find(".event-title a").focus();
28
+ $(this).closest("div.details").toggle();
29
+ });
30
+
31
$(document).on( 'keydown', function(e) {
32
var keycode = ( e.keyCode ? e.keyCode : e.which );
33
if ( keycode == 27 ) {
35
$( '.calendar-event div.details' ).hide();
36
}
37
});
38
+
39
+ $(document).on( 'keydown', '.details a, .details object, .details :input, .details iframe, .details [tabindex]',
40
function(e) {
41
var keycode = ( e.keyCode ? e.keyCode : e.which );
42
var action = $( ':focus' ).attr( 'data-action' );
47
if ( ( e.shiftKey && keycode == 9 ) && action == 'shiftforward' ) {
48
e.preventDefault();
49
$( '[data-action=shiftback]' ).focus();
50
+ }
51
});
52
+ });
53
+ }(jQuery));
my-calendar-api.php CHANGED
@@ -24,7 +24,7 @@ function my_calendar_api() {
24
if ( $api_key ) {
25
$format = ( isset( $_REQUEST['my-calendar-api'] ) ) ? $_REQUEST['my-calendar-api'] : 'json';
26
$from = ( isset( $_REQUEST['from'] ) ) ? $_REQUEST['from'] : date( 'Y-m-d', current_time( 'timestamp' ) );
27
- $to = ( isset( $_REQUEST['to'] ) ) ? $_REQUEST['to'] : date( 'Y-m-d', strtotime( current_time( 'timestamp' ) . apply_filters( 'mc_api_auto_date', '+ 7 days' ) ) );
28
// sanitization is handled elsewhere.
29
$category = ( isset( $_REQUEST['mcat'] ) ) ? $_REQUEST['mcat'] : '';
30
$ltype = ( isset( $_REQUEST['ltype'] ) ) ? $_REQUEST['ltype'] : '';
@@ -97,6 +97,7 @@ function mc_api_format_csv( $data ) {
97
foreach ( $data as $key => $val ) {
98
foreach ( $val as $v ) {
99
$values = get_object_vars( $v );
100
if ( ! $keyed ) {
101
$keys = array_keys( $values );
102
fputcsv( $stream, $keys );
24
if ( $api_key ) {
25
$format = ( isset( $_REQUEST['my-calendar-api'] ) ) ? $_REQUEST['my-calendar-api'] : 'json';
26
$from = ( isset( $_REQUEST['from'] ) ) ? $_REQUEST['from'] : date( 'Y-m-d', current_time( 'timestamp' ) );
27
+ $to = ( isset( $_REQUEST['to'] ) ) ? $_REQUEST['to'] : date( 'Y-m-d', strtotime( apply_filters( 'mc_api_auto_date', '+ 7 days' ) ) );
28
// sanitization is handled elsewhere.
29
$category = ( isset( $_REQUEST['mcat'] ) ) ? $_REQUEST['mcat'] : '';
30
$ltype = ( isset( $_REQUEST['ltype'] ) ) ? $_REQUEST['ltype'] : '';
97
foreach ( $data as $key => $val ) {
98
foreach ( $val as $v ) {
99
$values = get_object_vars( $v );
100
+ unset( $values['categories'] );
101
if ( ! $keyed ) {
102
$keys = array_keys( $values );
103
fputcsv( $stream, $keys );
my-calendar-core.php CHANGED
@@ -148,6 +148,7 @@ function mc_register_styles() {
148
wp_enqueue_style( 'my-calendar-admin-style' );
149
}
150
151
$id = ( is_object( $this_post ) && isset( $this_post->ID ) ) ? $this_post->ID : false;
152
$js_array = ( '' != get_option( 'mc_show_js' ) ) ? explode( ',', get_option( 'mc_show_js' ) ) : array();
153
$css_array = ( '' != get_option( 'mc_show_css' ) ) ? explode( ',', get_option( 'mc_show_css' ) ) : array();
@@ -165,9 +166,9 @@ function mc_register_styles() {
165
}
166
}
167
}
168
-
169
if ( 'true' != get_option( 'mc_use_styles' ) ) {
170
- if ( is_array( $css_array ) && in_array( $id, $css_array ) || get_option( 'mc_show_css' ) == '' ) {
171
wp_enqueue_style( 'my-calendar-style' );
172
}
173
}
@@ -893,33 +894,29 @@ function my_calendar_send_email( $event ) {
893
* @return boolean true if spam
894
*/
895
function mc_spam( $event_url = '', $description = '', $post = array() ) {
896
- global $akismet_api_host, $akismet_api_port, $current_user;
897
- $wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? WPCOM_API_KEY : false;
898
- $current_user = wp_get_current_user();
899
- if ( current_user_can( 'mc_manage_events' ) ) { // is a privileged user.
900
- return 0;
901
}
902
$akismet = false;
903
$c = array();
904
// check for Akismet.
905
- if ( function_exists( 'akismet_http_post' ) && ( get_option( 'wordpress_api_key' ) || $wpcom_api_key ) ) {
906
$akismet = true;
907
}
908
if ( $akismet ) {
909
- $c['blog'] = get_option( 'home' );
910
- $c['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );
911
- $c['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
912
- $c['referrer'] = $_SERVER['HTTP_REFERER'];
913
- $c['comment_type'] = 'my_calendar_event';
914
- if ( get_permalink() == $permalink ) {
915
- $c['permalink'] = $permalink;
916
- }
917
- if ( '' != $event_url ) {
918
- $c['comment_author_url'] = $event_url;
919
- }
920
- if ( '' != $description ) {
921
- $c['comment_content'] = $description;
922
- }
923
$ignore = array( 'HTTP_COOKIE' );
924
925
foreach ( $_SERVER as $key => $value ) {
@@ -931,7 +928,11 @@ function mc_spam( $event_url = '', $description = '', $post = array() ) {
931
foreach ( $c as $key => $data ) {
932
$query_string .= $key . '=' . urlencode( stripslashes( (string) $data ) ) . '&';
933
}
934
- $response = akismet_http_post( $query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port );
935
if ( 'true' == $response[1] ) {
936
return 1;
937
} else {
@@ -942,6 +943,28 @@ function mc_spam( $event_url = '', $description = '', $post = array() ) {
942
return 0;
943
}
944
945
add_action( 'admin_enqueue_scripts', 'mc_scripts' );
946
/**
947
* Enqueue My Calendar admin scripts
@@ -1006,14 +1029,11 @@ function mc_scripts() {
1006
wp_enqueue_media();
1007
}
1008
}
1009
-
1010
- if ( 'my-calendar_page_my-calendar-locations' == $id ) {
1011
- if ( 'true' == get_option( 'mc_gmap' ) ) {
1012
- $api_key = get_option( 'mc_gmap_api_key' );
1013
- if ( $api_key ) {
1014
- wp_enqueue_script( 'gmaps', "https://maps.googleapis.com/maps/api/js?key=$api_key" );
1015
- wp_enqueue_script( 'gmap3', plugins_url( 'js/gmap3.min.js', __FILE__ ), array( 'jquery' ) );
1016
- }
1017
}
1018
}
1019
@@ -1260,7 +1280,7 @@ function mc_guess_calendar() {
1260
* Set up support form
1261
*/
1262
function mc_get_support_form() {
1263
- global $current_user;
1264
$current_user = wp_get_current_user();
1265
// send fields for My Calendar.
1266
$version = get_option( 'mc_version' );
@@ -1286,6 +1306,7 @@ function mc_get_support_form() {
1286
$charset = get_bloginfo( 'charset' );
1287
// server.
1288
$php_version = phpversion();
1289
$admin_email = get_option( 'admin_email' );
1290
// theme data.
1291
$theme = wp_get_theme();
@@ -1326,6 +1347,7 @@ Charset: $charset
1326
1327
==Extra info:==
1328
PHP Version: $php_version
1329
Server Software: $_SERVER[SERVER_SOFTWARE]
1330
User Agent: $_SERVER[HTTP_USER_AGENT]
1331
@@ -1368,7 +1390,7 @@ $plugins_string
1368
if ( 'Donor' == $has_donated || 'Purchaser' == $has_purchased ) {
1369
mc_show_notice( __( 'Thank you for supporting the continuing development of this plug-in! I\'ll get back to you as soon as I can.', 'my-calendar' ) );
1370
} else {
1371
- mc_show_notice( __( 'I\'ll get back to you as soon as I can, after dealing with any support requests from plug-in supporters.', 'my-calendar' ) );
1372
}
1373
} else {
1374
// Translators: Support form URL.
148
wp_enqueue_style( 'my-calendar-admin-style' );
149
}
150
151
+ $default = apply_filters( 'mc_display_css_on_archives', true, $wp_query );
152
$id = ( is_object( $this_post ) && isset( $this_post->ID ) ) ? $this_post->ID : false;
153
$js_array = ( '' != get_option( 'mc_show_js' ) ) ? explode( ',', get_option( 'mc_show_js' ) ) : array();
154
$css_array = ( '' != get_option( 'mc_show_css' ) ) ? explode( ',', get_option( 'mc_show_css' ) ) : array();
166
}
167
}
168
}
169
+ // True means styles are disabled.
170
if ( 'true' != get_option( 'mc_use_styles' ) ) {
171
+ if ( ( $default && ! $id ) || ( is_array( $css_array ) && in_array( $id, $css_array ) || get_option( 'mc_show_css' ) == '' ) ) {
172
wp_enqueue_style( 'my-calendar-style' );
173
}
174
}
894
* @return boolean true if spam
895
*/
896
function mc_spam( $event_url = '', $description = '', $post = array() ) {
897
+ global $akismet_api_host, $akismet_api_port;
898
+ if ( current_user_can( 'mc_manage_events' ) || apply_filters( 'mc_disable_spam_checking', false, $post ) ) { // is a privileged user.
899
+ return apply_filters( 'mc_custom_spam_status', 0, $post );
900
}
901
$akismet = false;
902
$c = array();
903
// check for Akismet.
904
+ if ( ( function_exists( 'akismet_http_post' ) || method_exists( 'Akismet', 'http_post' ) ) && ( akismet_get_key() ) ) {
905
$akismet = true;
906
}
907
if ( $akismet ) {
908
+ $c['blog'] = home_url();
909
+ $c['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );
910
+ $c['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
911
+ $c['referrer'] = $_SERVER['HTTP_REFERER'];
912
+ $c['comment_type'] = 'calendar-event';
913
+ $c['blog_lang'] = get_bloginfo( 'language' );
914
+ $c['blog_charset'] = get_bloginfo( 'charset' );
915
+ $c['comment_author_url'] = $event_url;
916
+ $c['comment_content'] = $description;
917
+ $c['comment_author'] = $post['mcs_name'];
918
+ $c['comment_author_email'] = $post['mcs_email'];
919
+
920
$ignore = array( 'HTTP_COOKIE' );
921
922
foreach ( $_SERVER as $key => $value ) {
928
foreach ( $c as $key => $data ) {
929
$query_string .= $key . '=' . urlencode( stripslashes( (string) $data ) ) . '&';
930
}
931
+ if ( method_exists( 'Akismet', 'http_post' ) ) {
932
+ $response = Akismet::http_post( $query_string, 'comment-check' );
933
+ } else {
934
+ $response = akismet_http_post( $query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port );
935
+ }
936
if ( 'true' == $response[1] ) {
937
return 1;
938
} else {
943
return 0;
944
}
945
946
+ /**
947
+ * Cache total number of events for admin.
948
+ */
949
+ function mc_update_count_cache() {
950
+ global $wpdb;
951
+ $published = $wpdb->get_var( 'SELECT count( event_id ) FROM ' . my_calendar_table() . ' WHERE event_approved = 1' ); // WPCS: unprepared SQL OK.
952
+ $draft = $wpdb->get_var( 'SELECT count( event_id ) FROM ' . my_calendar_table() . ' WHERE event_approved = 0' ); // WPCS: unprepared SQL OK.
953
+ $trash = $wpdb->get_var( 'SELECT count( event_id ) FROM ' . my_calendar_table() . ' WHERE event_approved = 2' ); // WPCS: unprepared SQL OK.
954
+ $archive = $wpdb->get_var( 'SELECT count( event_id ) FROM ' . my_calendar_table() . ' WHERE event_status = 0' ); // WPCS: unprepared SQL OK.
955
+ $spam = $wpdb->get_var( 'SELECT count( event_id ) FROM ' . my_calendar_table() . ' WHERE event_flagged = 1' ); // WPCS: unprepared SQL OK.
956
+ $counts = array(
957
+ 'published' => $published,
958
+ 'draft' => $draft,
959
+ 'trash' => $trash,
960
+ 'archive' => $archive,
961
+ 'spam' => $spam,
962
+ );
963
+ update_option( 'mc_count_cache', $counts );
964
+
965
+ return $counts;
966
+ }
967
+
968
add_action( 'admin_enqueue_scripts', 'mc_scripts' );
969
/**
970
* Enqueue My Calendar admin scripts
1029
wp_enqueue_media();
1030
}
1031
}
1032
+ if ( 'my-calendar_page_my-calendar-locations' == $id || 'toplevel_page_my-calendar' == $id ) {
1033
+ $api_key = get_option( 'mc_gmap_api_key' );
1034
+ if ( $api_key ) {
1035
+ wp_enqueue_script( 'gmaps', "https://maps.googleapis.com/maps/api/js?key=$api_key" );
1036
+ wp_enqueue_script( 'gmap3', plugins_url( 'js/gmap3.min.js', __FILE__ ), array( 'jquery' ) );
1037
}
1038
}
1039
1280
* Set up support form
1281
*/
1282
function mc_get_support_form() {
1283
+ global $current_user, $wpdb;
1284
$current_user = wp_get_current_user();
1285
// send fields for My Calendar.
1286
$version = get_option( 'mc_version' );
1306
$charset = get_bloginfo( 'charset' );
1307
// server.
1308
$php_version = phpversion();
1309
+ $db_version = $wpdb->db_version();
1310
$admin_email = get_option( 'admin_email' );
1311
// theme data.
1312
$theme = wp_get_theme();
1347
1348
==Extra info:==
1349
PHP Version: $php_version
1350
+ DB Version: $db_version
1351
Server Software: $_SERVER[SERVER_SOFTWARE]
1352
User Agent: $_SERVER[HTTP_USER_AGENT]
1353
1390
if ( 'Donor' == $has_donated || 'Purchaser' == $has_purchased ) {
1391
mc_show_notice( __( 'Thank you for supporting the continuing development of this plug-in! I\'ll get back to you as soon as I can.', 'my-calendar' ) );
1392
} else {
1393
+ mc_show_notice( __( 'I\'ll get back to you as soon as I can, after dealing with any support requests from plug-in supporters.', 'my-calendar' ) . __( 'You should receive an automatic response to your request when I receive it. If you do not receive this notice, then either I did not receive your message or the email it was sent from was not a valid address.', 'my-calendar' ) );
1394
}
1395
} else {
1396
// Translators: Support form URL.
my-calendar-event-manager.php CHANGED
@@ -30,7 +30,7 @@ function mc_event_post( $action, $data, $event_id ) {
30
if ( isset( $_POST['event_post'] ) && ( 0 == $_POST['event_post'] || '' == $_POST['event_post'] ) ) {
31
$post_id = mc_create_event_post( $data, $event_id );
32
} else {
33
- $post_id = $_POST['event_post'];
34
}
35
// If, after all that, the post doesn't exist, create it.
36
if ( ! get_post_status( $post_id ) ) {
@@ -113,7 +113,11 @@ function mc_add_post_meta_data( $post_id, $post, $data, $event_id ) {
113
// access features for the event.
114
$description = isset( $data['event_desc'] ) ? $data['event_desc'] : '';
115
$image = isset( $data['event_image'] ) ? esc_url_raw( $data['event_image'] ) : '';
116
-
117
update_post_meta( $post_id, '_mc_event_shortcode', $data['shortcode'] );
118
update_post_meta( $post_id, '_mc_event_access', ( isset( $_POST['events_access'] ) ) ? $_POST['events_access'] : '' );
119
update_post_meta( $post_id, '_mc_event_id', $event_id );
@@ -293,10 +297,25 @@ function mc_bulk_action( $action ) {
293
case 'trash':
294
$sql = 'UPDATE ' . my_calendar_table() . ' SET event_approved = 2 WHERE event_id IN (' . $prepared . ')';
295
break;
296
}
297
298
$result = $wpdb->query( $wpdb->prepare( $sql, $ids ) ); // WPCS: unprepared SQL OK.
299
300
$results = array(
301
'count' => $i,
302
'total' => $total,
@@ -347,6 +366,11 @@ function mc_bulk_message( $results, $action ) {
347
$success = __( '%1$d events removed from archive successfully out of %2$d selected', 'my-calendar' );
348
$error = __( 'Your events have not been removed from the archive. Please investigate.', 'my-calendar' );
349
break;
350
}
351
352
if ( 0 !== $result && false !== $result ) {
@@ -456,6 +480,7 @@ function my_calendar_manage() {
456
if ( current_user_can( 'mc_approve_events' ) ) {
457
$event_id = absint( $_GET['event_id'] );
458
$wpdb->get_results( $wpdb->prepare( 'UPDATE ' . my_calendar_table() . ' SET event_approved = 1 WHERE event_id=%d', $event_id ) ); // WPCS: unprepared SQL OK.
459
} else {
460
mc_show_error( __( 'You do not have permission to approve that event.', 'my-calendar' ) );
461
}
@@ -466,6 +491,7 @@ function my_calendar_manage() {
466
if ( current_user_can( 'mc_approve_events' ) ) {
467
$event_id = absint( $_GET['event_id'] );
468
$wpdb->get_results( $wpdb->prepare( 'UPDATE ' . my_calendar_table() . ' SET event_approved = 2 WHERE event_id=%d', $event_id ) ); // WPCS: unprepared SQL OK.
469
} else {
470
mc_show_error( __( 'You do not have permission to trash that event.', 'my-calendar' ) );
471
}
@@ -500,6 +526,11 @@ function my_calendar_manage() {
500
$results = mc_bulk_action( 'unarchive' );
501
echo $results;
502
}
503
}
504
?>
505
<div class='wrap my-calendar-admin'>
@@ -737,8 +768,11 @@ function my_calendar_save( $action, $output, $event_id = false ) {
737
$result = $wpdb->update( my_calendar_table(), $update, array(
738
'event_id' => $event_id,
739
), $formats, '%d' );
740
-
741
- $recur_changed = ( $update['event_repeats'] != $_POST['prev_event_repeats'] || $update['event_recur'] != $_POST['prev_event_recur'] ) ? true : false;
742
if ( $date_changed || $recur_changed ) {
743
// Function mc_increment_event uses previous events and re-uses same ID if new has same date as old event.
744
$instances = mc_get_instances( $event_id );
@@ -757,7 +791,10 @@ function my_calendar_save( $action, $output, $event_id = false ) {
757
if ( isset( $post['event_approved'] ) && $post['event_approved'] != $event_approved ) {
758
$event_approved = absint( $post['event_approved'] );
759
}
760
- do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], $event_approved );
761
$message = mc_show_notice( __( 'Event updated successfully', 'my-calendar' ) . ". $url", false );
762
}
763
} else {
@@ -770,6 +807,7 @@ function my_calendar_save( $action, $output, $event_id = false ) {
770
'event_id' => $event_id,
771
'message' => $message,
772
);
773
774
return apply_filters( 'mc_event_saved_message', $saved_response );
775
}
@@ -1941,34 +1979,66 @@ function mc_list_events() {
1941
1942
$found_rows = $wpdb->get_col( 'SELECT FOUND_ROWS();' );
1943
$items = $found_rows[0];
1944
-
1945
?>
1946
<ul class="links">
1947
<li>
1948
- <a <?php echo ( isset( $_GET['limit'] ) && 'published' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?> href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
1949
</li>
1950
<li>
1951
- <a <?php echo ( isset( $_GET['limit'] ) && 'draft' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?> href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=draft' ); ?>"><?php _e( 'Drafts', 'my-calendar' ); ?></a>
1952
</li>
1953
<li>
1954
<a <?php echo ( isset( $_GET['limit'] ) && 'trashed' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
1955
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=trashed' ); ?>"><?php _e( 'Trash', 'my-calendar' ); ?></a>
1956
</li>
1957
<li>
1958
<a <?php echo ( isset( $_GET['restrict'] ) && 'archived' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
1959
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
1960
</li>
1961
- <?php
1962
- if ( function_exists( 'akismet_http_post' ) && $allow_filters ) {
1963
- ?>
1964
<li>
1965
- <a <?php echo ( isset( $_GET['restrict'] ) && 'flagged' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?> href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
1966
</li>
1967
- <?php
1968
- }
1969
- ?>
1970
<li>
1971
- <a <?php echo ( isset( $_GET['limit'] ) && 'all' == $_GET['limit'] || ( ! isset( $_GET['limit'] ) && ! isset( $_GET['restrict'] ) ) ) ? 'class="active-link" aria-current="true"' : ''; ?> href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
1972
</li>
1973
</ul>
1974
<?php
@@ -2016,6 +2086,9 @@ function mc_list_events() {
2016
} else {
2017
echo '<input type="submit" class="button-secondary mc-archive" name="mass_undo_archive" value="' . __( 'Remove from archive', 'my-calendar' ) . '" /> ';
2018
}
2019
?>
2020
</div>
2021
@@ -2237,22 +2310,51 @@ function mc_list_events() {
2237
<ul class="links">
2238
<li>
2239
<a <?php echo ( isset( $_GET['limit'] ) && 'published' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2240
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=published' ); ?>"><?php _e( 'Published', 'my-calendar' ); ?></a>
2241
</li>
2242
<li>
2243
<a <?php echo ( isset( $_GET['limit'] ) && 'draft' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2244
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=draft' ); ?>"><?php _e( 'Drafts', 'my-calendar' ); ?></a>
2245
</li>
2246
<li>
2247
<a <?php echo ( isset( $_GET['restrict'] ) && 'archived' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2248
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=archived' ); ?>"><?php _e( 'Archived', 'my-calendar' ); ?></a>
2249
</li>
2250
<?php
2251
if ( function_exists( 'akismet_http_post' ) && $allow_filters ) {
2252
?>
2253
<li>
2254
<a <?php echo ( isset( $_GET['restrict'] ) && 'flagged' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2255
- href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1' ); ?>"><?php _e( 'Spam', 'my-calendar' ); ?></a>
2256
</li>
2257
<?php
2258
}
@@ -2490,7 +2592,7 @@ function mc_check_data( $action, $post, $i ) {
2490
$event_holiday = ! empty( $post['event_holiday'] ) ? 1 : 0;
2491
$group_id = (int) $post['event_group_id'];
2492
$event_group_id = ( ( is_array( $post['event_begin'] ) && count( $post['event_begin'] ) > 1 ) || mc_event_is_grouped( $group_id ) ) ? $group_id : 0;
2493
- $event_span = ( ! empty( $post['event_span'] ) && 0 != event_group_id ) ? 1 : 0;
2494
$event_hide_end = ( ! empty( $post['event_hide_end'] ) ) ? (int) $post['event_hide_end'] : 0;
2495
$event_hide_end = ( '' == $time || '23:59:59' == $time ) ? 1 : $event_hide_end; // Hide end time on all day events.
2496
// Set location.
@@ -2595,13 +2697,18 @@ function mc_check_data( $action, $post, $i ) {
2595
$repeats = 0;
2596
$recur = 'S1';
2597
}
2598
- if ( function_exists( 'mcs_submissions' ) && isset( $post['mcs_check_conflicts'] ) ) {
2599
$conflicts = mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label );
2600
if ( $conflicts ) {
2601
- $errors .= mc_show_error( __( 'That event conflicts with a previously scheduled event.', 'my-calendar' ), false );
2602
}
2603
}
2604
- $spam = mc_spam( $event_link, $desc, $post );
2605
// Likelihood that event will be flagged as spam, have a zero start time and be legit is minimal. Just kill it.
2606
if ( 1 == $spam && '1970-01-01' == $begin ) {
2607
die;
@@ -2739,10 +2846,10 @@ function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
2739
JOIN ' . my_calendar_table() . "
2740
ON (event_id=occur_event_id)
2741
WHERE $select_location " . '
2742
- ( occur_begin BETWEEN cast( %1$s AS DATETIME ) AND cast( %2$s AS DATETIME )
2743
- OR occur_end BETWEEN cast( %1$s AS DATETIME ) AND cast( %2$s AS DATETIME ) )';
2744
2745
- $results = $wpdb->get_results( $wpdb->prepare( $event_query, $begin_time, $end_time ) ); // WPCS: Unprepared SQL ok.
2746
2747
if ( empty( $results ) ) {
2748
// Alternate: where "begin time" between occur_begin & occur_end OR "end time" between occur_begin & occur_end.
@@ -2753,8 +2860,8 @@ function mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label ) {
2753
JOIN ' . my_calendar_table() . "
2754
ON (event_id=occur_event_id)
2755
WHERE $select_location " . '
2756
- ( cast( %1$s AS DATETIME ) BETWEEN occur_begin AND occur_end
2757
- OR cast( %2$s AS DATETIME ) BETWEEN occur_begin AND occur_end )';
2758
2759
$results = $wpdb->get_results( $wpdb->prepare( $event_query2, $begin_time, $end_time ) ); // WPCS: Unprepared SQL ok.
2760
}
@@ -2875,7 +2982,7 @@ function mc_instance_list( $args ) {
2875
$list = isset( $args['list'] ) ? $args['list'] : '<li>{date}, {time}</li>';
2876
$before = isset( $args['before'] ) ? $args['before'] : '<ul>';
2877
$after = isset( $args['after'] ) ? $args['after'] : '</ul>';
2878
- $instance = isset( $args['instance'] ) ? true : false;
2879
2880
global $wpdb;
2881
$output = '';
@@ -3098,7 +3205,7 @@ add_action( 'save_post', 'mc_post_update_event' );
3098
*/
3099
function mc_post_update_event( $id ) {
3100
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $id ) || ! ( get_post_type( $id ) == 'mc-events' ) ) {
3101
- return;
3102
}
3103
$post = get_post( $id );
3104
$featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
@@ -3347,11 +3454,13 @@ function mc_can_edit_event( $event = false ) {
3347
$event = mc_get_first_event( $event );
3348
$event_author = $event->event_author;
3349
} else {
3350
$event_author = wp_get_current_user()->ID;
3351
}
3352
$current_user = wp_get_current_user();
3353
$user = $current_user->ID;
3354
- $categories = mc_get_categories( $event->event_id );
3355
$has_permissions = true;
3356
if ( is_array( $categories ) ) {
3357
foreach ( $categories as $cat ) {
30
if ( isset( $_POST['event_post'] ) && ( 0 == $_POST['event_post'] || '' == $_POST['event_post'] ) ) {
31
$post_id = mc_create_event_post( $data, $event_id );
32
} else {
33
+ $post_id = ( isset( $_POST['event_post'] ) ) ? absint( $_POST['event_post'] ) : false;
34
}
35
// If, after all that, the post doesn't exist, create it.
36
if ( ! get_post_status( $post_id ) ) {
113
// access features for the event.
114
$description = isset( $data['event_desc'] ) ? $data['event_desc'] : '';
115
$image = isset( $data['event_image'] ) ? esc_url_raw( $data['event_image'] ) : '';
116
+ $guid = get_post_meta( $post_id, '_mc_guid', true );
117
+ if ( '' == $guid ) {
118
+ $guid = md5( $post_id . $event_id . $data['event_title'] );
119
+ update_post_meta( $post_id, '_mc_guid', $guid );
120
+ }
121
update_post_meta( $post_id, '_mc_event_shortcode', $data['shortcode'] );
122
update_post_meta( $post_id, '_mc_event_access', ( isset( $_POST['events_access'] ) ) ? $_POST['events_access'] : '' );
123
update_post_meta( $post_id, '_mc_event_id', $event_id );
297
case 'trash':
298
$sql = 'UPDATE ' . my_calendar_table() . ' SET event_approved = 2 WHERE event_id IN (' . $prepared . ')';
299
break;
300
+ case 'unspam':
301
+ $sql = 'UPDATE ' . my_calendar_table() . ' SET event_flagged = 0 WHERE event_id IN (' . $prepared . ')';
302
+ // send ham report to Akismet.
303
+ // send notifications.
304
+ foreach ( $ids as $id ) {
305
+ $post_ID = mc_get_event_post( $event_id );
306
+ $submitter = get_post_meta( $post_ID, '_submitter_details', true );
307
+ if ( is_array( $submitter ) && ! empty( $submitter ) ) {
308
+ $name = $submitter['first_name'] . ' ' . $submitter['last_name'];
309
+ $email = $submitter['email'];
310
+ do_action( 'mcs_complete_submission', $name, $email, $event_id, 'edit' );
311
+ }
312
+ }
313
+ break;
314
}
315
316
$result = $wpdb->query( $wpdb->prepare( $sql, $ids ) ); // WPCS: unprepared SQL OK.
317
318
+ mc_update_count_cache();
319
$results = array(
320
'count' => $i,
321
'total' => $total,
366
$success = __( '%1$d events removed from archive successfully out of %2$d selected', 'my-calendar' );
367
$error = __( 'Your events have not been removed from the archive. Please investigate.', 'my-calendar' );
368
break;
369
+ case 'unspam':
370
+ // Translators: Number of events removed from archive, number of events selected.
371
+ $success = __( '%1$d events successfully unmarked as spam out of %2$d selected', 'my-calendar' );
372
+ $error = __( 'Your events have not unmarked as spam. Please investigate.', 'my-calendar' );
373
+ break;
374
}
375
376
if ( 0 !== $result && false !== $result ) {
480
if ( current_user_can( 'mc_approve_events' ) ) {
481
$event_id = absint( $_GET['event_id'] );
482
$wpdb->get_results( $wpdb->prepare( 'UPDATE ' . my_calendar_table() . ' SET event_approved = 1 WHERE event_id=%d', $event_id ) ); // WPCS: unprepared SQL OK.
483
+ mc_update_count_cache();
484
} else {
485
mc_show_error( __( 'You do not have permission to approve that event.', 'my-calendar' ) );
486
}
491
if ( current_user_can( 'mc_approve_events' ) ) {
492
$event_id = absint( $_GET['event_id'] );
493
$wpdb->get_results( $wpdb->prepare( 'UPDATE ' . my_calendar_table() . ' SET event_approved = 2 WHERE event_id=%d', $event_id ) ); // WPCS: unprepared SQL OK.
494
+ mc_update_count_cache();
495
} else {
496
mc_show_error( __( 'You do not have permission to trash that event.', 'my-calendar' ) );
497
}
526
$results = mc_bulk_action( 'unarchive' );
527
echo $results;
528
}
529
+
530
+ if ( isset( $_POST['mass_not_spam'] ) ) {
531
+ $results = mc_bulk_action( 'unspam' );
532
+ echo $results;
533
+ }
534
}
535
?>
536
<div class='wrap my-calendar-admin'>
768
$result = $wpdb->update( my_calendar_table(), $update, array(
769
'event_id' => $event_id,
770
), $formats, '%d' );
771
+ if ( isset( $_POST['prev_event_repeats'] ) && isset( $_POST['prev_event_recur'] ) ) {
772
+ $recur_changed = ( $update['event_repeats'] != $_POST['prev_event_repeats'] || $update['event_recur'] != $_POST['prev_event_recur'] ) ? true : false;
773
+ } else {
774
+ $recur_changed = false;
775
+ }
776
if ( $date_changed || $recur_changed ) {
777
// Function mc_increment_event uses previous events and re-uses same ID if new has same date as old event.
778
$instances = mc_get_instances( $event_id );
791
if ( isset( $post['event_approved'] ) && $post['event_approved'] != $event_approved ) {
792
$event_approved = absint( $post['event_approved'] );
793
}
794
+ if ( isset( $_POST['prev_event_status'] ) ) {
795
+ // Don't execute transition actions if prev status not known.
796
+ do_action( 'mc_transition_event', (int) $_POST['prev_event_status'], $event_approved );
797
+ }
798
$message = mc_show_notice( __( 'Event updated successfully', 'my-calendar' ) . ". $url", false );
799
}
800
} else {
807
'event_id' => $event_id,
808
'message' => $message,
809
);
810
+ mc_update_count_cache();
811
812
return apply_filters( 'mc_event_saved_message', $saved_response );
813
}
1979
1980
$found_rows = $wpdb->get_col( 'SELECT FOUND_ROWS();' );
1981
$items = $found_rows[0];
1982
+ $counts = get_option( 'mc_count_cache' );
1983
+ if ( empty( $counts ) ) {
1984
+ $counts = mc_update_count_cache();
1985
+ }
1986
?>
1987
<ul class="links">
1988
<li>
1989
+ <a <?php echo ( isset( $_GET['limit'] ) && 'published' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
1990
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=published' ); ?>">
1991
+ <?php
1992
+ // Translators: Number of published events.
1993
+ printf( __( 'Published (%d)', 'my-calendar' ), $counts['published'] );
1994
+ ?>
1995
+ </a>
1996
</li>
1997
<li>
1998
+ <a <?php echo ( isset( $_GET['limit'] ) && 'draft' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
1999
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=draft' ); ?>">
2000
+ <?php
2001
+ // Translators: Number of draft events.
2002
+ printf( __( 'Drafts (%d)', 'my-calendar' ), $counts['draft'] );
2003
+ ?>
2004
+ </a>
2005
</li>
2006
<li>
2007
<a <?php echo ( isset( $_GET['limit'] ) && 'trashed' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2008
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=trashed' ); ?>">
2009
+ <?php
2010
+ // Translators: Number of trashed events.
2011
+ printf( __( 'Trash (%d)', 'my-calendar' ), $counts['trash'] );
2012
+ ?>
2013
+ </a>
2014
</li>
2015
<li>
2016
<a <?php echo ( isset( $_GET['restrict'] ) && 'archived' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2017
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=archived' ); ?>">
2018
+ <?php
2019
+ // Translators: Number of archived events.
2020
+ printf( __( 'Archived (%d)', 'my-calendar' ), $counts['archive'] );
2021
+ ?>
2022
+ </a>
2023
</li>
2024
+ <?php
2025
+ if ( function_exists( 'akismet_http_post' ) && $allow_filters ) {
2026
+ ?>
2027
<li>
2028
+ <a <?php echo ( isset( $_GET['restrict'] ) && 'flagged' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2029
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1' ); ?>">
2030
+ <?php
2031
+ // Translators: Number of events marked as spam.
2032
+ printf( __( 'Spam (%d)', 'my-calendar' ), $counts['spam'] );
2033
+ ?>
2034
+ </a>
2035
</li>
2036
+ <?php
2037
+ }
2038
+ ?>
2039
<li>
2040
+ <a <?php echo ( isset( $_GET['limit'] ) && 'all' == $_GET['limit'] || ( ! isset( $_GET['limit'] ) && ! isset( $_GET['restrict'] ) ) ) ? 'class="active-link" aria-current="true"' : ''; ?>
2041
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=all' ); ?>"><?php _e( 'All', 'my-calendar' ); ?></a>
2042
</li>
2043
</ul>
2044
<?php
2086
} else {
2087
echo '<input type="submit" class="button-secondary mc-archive" name="mass_undo_archive" value="' . __( 'Remove from archive', 'my-calendar' ) . '" /> ';
2088
}
2089
+ if ( isset( $_GET['restrict'] ) && 'flagged' == $_GET['restrict'] ) {
2090
+ echo '<input type="submit" class="button-secondary mc-archive" name="mass_not_spam" value="' . __( 'Not spam', 'my-calendar' ) . '" /> ';
2091
+ }
2092
?>
2093
</div>
2094
2310
<ul class="links">
2311
<li>
2312
<a <?php echo ( isset( $_GET['limit'] ) && 'published' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2313
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=published' ); ?>">
2314
+ <?php
2315
+ // Translators: Number of published events.
2316
+ printf( __( 'Published (%d)', 'my-calendar' ), $counts['published'] );
2317
+ ?>
2318
+ </a>
2319
</li>
2320
<li>
2321
<a <?php echo ( isset( $_GET['limit'] ) && 'draft' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2322
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=draft' ); ?>">
2323
+ <?php
2324
+ // Translators: Number of draft events.
2325
+ printf( __( 'Drafts (%d)', 'my-calendar' ), $counts['draft'] );
2326
+ ?>
2327
+ </a>
2328
+ </li>
2329
+ <li>
2330
+ <a <?php echo ( isset( $_GET['limit'] ) && 'trashed' == $_GET['limit'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2331
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;limit=trashed' ); ?>">
2332
+ <?php
2333
+ // Translators: Number of trashed events.
2334
+ printf( __( 'Trash (%d)', 'my-calendar' ), $counts['trash'] );
2335
+ ?>
2336
+ </a>
2337
</li>
2338
<li>
2339
<a <?php echo ( isset( $_GET['restrict'] ) && 'archived' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2340
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=archived' ); ?>">
2341
+ <?php
2342
+ // Translators: Number of archived events.
2343
+ printf( __( 'Archived (%d)', 'my-calendar' ), $counts['archive'] );
2344
+ ?>
2345
+ </a>
2346
</li>
2347
<?php
2348
if ( function_exists( 'akismet_http_post' ) && $allow_filters ) {
2349
?>
2350
<li>
2351
<a <?php echo ( isset( $_GET['restrict'] ) && 'flagged' == $_GET['restrict'] ) ? 'class="active-link" aria-current="true"' : ''; ?>
2352
+ href="<?php echo admin_url( 'admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1' ); ?>">
2353
+ <?php
2354
+ // Translators: Number of events marked as spam.
2355
+ printf( __( 'Spam (%d)', 'my-calendar' ), $counts['spam'] );
2356
+ ?>
2357
+ </a>
2358
</li>
2359
<?php
2360
}
2592
$event_holiday = ! empty( $post['event_holiday'] ) ? 1 : 0;
2593
$group_id = (int) $post['event_group_id'];
2594
$event_group_id = ( ( is_array( $post['event_begin'] ) && count( $post['event_begin'] ) > 1 ) || mc_event_is_grouped( $group_id ) ) ? $group_id : 0;
2595
+ $event_span = ( ! empty( $post['event_span'] ) && 0 != $event_group_id ) ? 1 : 0;
2596
$event_hide_end = ( ! empty( $post['event_hide_end'] ) ) ? (int) $post['event_hide_end'] : 0;
2597
$event_hide_end = ( '' == $time || '23:59:59' == $time ) ? 1 : $event_hide_end; // Hide end time on all day events.
2598
// Set location.
2697
$repeats = 0;
2698
$recur = 'S1';
2699
}
2700
+ if ( isset( $post['mcs_check_conflicts'] ) ) {
2701
$conflicts = mcs_check_conflicts( $begin, $time, $end, $endtime, $event_label );
2702
if ( $conflicts ) {
2703
+ $conflict_id = $conflicts[0]->occur_id;
2704
+ $conflict_ev = mc_get_event( $conflict_id );
2705
+ $conflict = mc_get_details_link( $conflict_ev );
2706
+ // Translators: URL to event details.
2707
+ $errors .= mc_show_error( sprintf( __( 'That event conflicts with a <a href="%s">previously scheduled event</a>.', 'my-calendar' ), $conflict ), false );
2708
}
2709
}
2710
+ $spam_content = ( '' != $desc ) ? $desc : $short;
2711
+ $spam = mc_spam( $event_link, $spam_content, $post );
2712
// Likelihood that event will be flagged as spam, have a zero start time and be legit is minimal. Just kill it.
2713
if ( 1 == $spam && '1970-01-01' == $begin ) {
2714
die;
2846
JOIN ' . my_calendar_table() . "
2847
ON (event_id=occur_event_id)
2848
WHERE $select_location " . '
2849
+ ( occur_begin BETWEEN cast( \'%1$s\' AS DATETIME ) AND cast( \'%2$s\' AS DATETIME )
2850
+ OR occur_end BETWEEN cast( \'%3$s\' AS DATETIME ) AND cast( \'%4$s\' AS DATETIME ) )';
2851
2852
+ $results = $wpdb->get_results( $wpdb->prepare( $event_query, $begin_time, $end_time, $begin_time, $end_time ) ); // WPCS: Unprepared SQL ok.
2853
2854
if ( empty( $results ) ) {
2855
// Alternate: where "begin time" between occur_begin & occur_end OR "end time" between occur_begin & occur_end.
2860
JOIN ' . my_calendar_table() . "
2861
ON (event_id=occur_event_id)
2862
WHERE $select_location " . '
2863
+ ( cast( \'%1$s\' AS DATETIME ) BETWEEN occur_begin AND occur_end
2864
+ OR cast( \'%2$s\' AS DATETIME ) BETWEEN occur_begin AND occur_end )';
2865
2866
$results = $wpdb->get_results( $wpdb->prepare( $event_query2, $begin_time, $end_time ) ); // WPCS: Unprepared SQL ok.
2867
}
2982
$list = isset( $args['list'] ) ? $args['list'] : '<li>{date}, {time}</li>';
2983
$before = isset( $args['before'] ) ? $args['before'] : '<ul>';
2984
$after = isset( $args['after'] ) ? $args['after'] : '</ul>';
2985
+ $instance = isset( $args['instance'] ) ? $args['instance'] : false;
2986
2987
global $wpdb;
2988
$output = '';
3205
*/
3206
function mc_post_update_event( $id ) {
3207
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || wp_is_post_revision( $id ) || ! ( get_post_type( $id ) == 'mc-events' ) ) {
3208
+ return $id;
3209
}
3210
$post = get_post( $id );
3211
$featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
3454
$event = mc_get_first_event( $event );
3455
$event_author = $event->event_author;
3456
} else {
3457
+ // What is the case where the event is neither an object, int, or falsey? Hmm.
3458
$event_author = wp_get_current_user()->ID;
3459
+ $event_id = $event;
3460
}
3461
$current_user = wp_get_current_user();
3462
$user = $current_user->ID;
3463
+ $categories = mc_get_categories( $event_id );
3464
$has_permissions = true;
3465
if ( is_array( $categories ) ) {
3466
foreach ( $categories as $cat ) {
my-calendar-events.php CHANGED
@@ -28,11 +28,33 @@ function mc_event_object( $object ) {
28
if ( ! property_exists( $object, 'location' ) && is_numeric( $object->event_location ) && 0 != $object->event_location ) {
29
$object->location = mc_get_location( $object->event_location );
30
}
31
}
32
33
return $object;
34
}
35
36
/**
37
* Grab all events for the requested dates from calendar
38
*
28
if ( ! property_exists( $object, 'location' ) && is_numeric( $object->event_location ) && 0 != $object->event_location ) {
29
$object->location = mc_get_location( $object->event_location );
30
}
31
+ if ( ! property_exists( $object, 'uid' ) ) {
32
+ $guid = get_post_meta( $object->event_post, '_mc_guid', true );
33
+ if ( '' == $guid ) {
34
+ $guid = mc_create_guid( $object );
35
+ }
36
+ $object->uid = $guid;
37
+ }
38
}
39
40
return $object;
41
}
42
43
+
44
+ /**
45
+ * Create a GUID for an event.
46
+ *
47
+ * @param object $event Event object.
48
+ *
49
+ * @return string GUID
50
+ */
51
+ function mc_create_guid( $event ) {
52
+ $guid = md5( $event->event_post . $event->event_id . $event->event_title );
53
+ update_post_meta( $event->event_post, '_mc_guid', $guid );
54
+
55
+ return $guid;
56
+ }
57
+
58
/**
59
* Grab all events for the requested dates from calendar
60
*
my-calendar-group-manager.php CHANGED
@@ -42,9 +42,7 @@ function my_calendar_group_edit() {
42
if ( isset( $_POST['apply'] ) && is_array( $_POST['apply'] ) ) {
43
$mc_output = mc_check_group_data( $action, $_POST );
44
foreach ( $_POST['apply'] as $event_id ) {
45
- if ( ! is_int( $event_id ) ) {
46
- continue;
47
- }
48
$response = my_calendar_save_group( $action, $mc_output, $event_id );
49
echo $response;
50
}
@@ -147,6 +145,7 @@ function my_calendar_save_group( $action, $output, $event_id = false ) {
147
global $wpdb, $event_author;
148
$proceed = $output[0];
149
$message = '';
150
if ( 'edit' == $action && true == $proceed ) {
151
$event_author = (int) ( $_POST['event_author'] );
152
if ( mc_can_edit_event( $event_id ) ) {
42
if ( isset( $_POST['apply'] ) && is_array( $_POST['apply'] ) ) {
43
$mc_output = mc_check_group_data( $action, $_POST );
44
foreach ( $_POST['apply'] as $event_id ) {
45
+ $event_id = absint( $event_id );
46
$response = my_calendar_save_group( $action, $mc_output, $event_id );
47
echo $response;
48
}
145
global $wpdb, $event_author;
146
$proceed = $output[0];
147
$message = '';
148
+
149
if ( 'edit' == $action && true == $proceed ) {
150
$event_author = (int) ( $_POST['event_author'] );
151
if ( mc_can_edit_event( $event_id ) ) {
my-calendar-output.php CHANGED
@@ -42,14 +42,19 @@ function mc_get_template( $template ) {
42
* @return string HTML output.
43
*/
44
function mc_time_html( $event, $type ) {
45
- $date_format = get_option( 'mc_date_format' );
46
- $date_format = ( '' != $date_format ) ? $date_format : get_option( 'date_format' );
47
if ( $event->event_end != $event->event_begin ) {
48
$mult_format = get_option( 'mc_multidate_format' );
49
$mult_format = ( '' != $mult_format ) ? $mult_format : 'F j-%d, Y';
50
$date_format = str_replace( '%d', date( 'j', strtotime( $event->occur_end ) ), $mult_format );
51
}
52
- $current = date_i18n( $date_format, strtotime( $event->occur_begin ) );
53
$id_start = date( 'Y-m-d', strtotime( $event->occur_begin ) );
54
$id_end = date( 'Y-m-d', strtotime( $event->occur_end ) );
55
$event_date = ( 'list' == $type ) ? '' : "<span class='mc-event-date dtstart' itemprop='startDate' title='" . $id_start . 'T' . $event->event_time . "' content='" . $id_start . 'T' . $event->event_time . "'>$current</span>";
@@ -235,6 +240,7 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
235
$description = '';
236
$link = '';
237
$vcal = '';
238
$gcal = '';
239
$image = '';
240
$tickets = '';
@@ -261,14 +267,15 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
261
$display_gmap = get_option( 'mc_gmap' );
262
$display_link = get_option( 'mc_event_link' );
263
$display_image = get_option( 'mc_image' );
264
$display_reg = get_option( 'mc_event_registration' );
265
- $uid = 'mc_' . $event->occur_id;
266
$day_id = date( 'd', strtotime( $process_date ) );
267
$image = mc_category_icon( $event );
268
$img = '';
269
$has_image = ( '' != $image ) ? ' has-image' : '';
270
$event_classes = mc_event_classes( $event, $day_id, $type );
271
- $header .= "<div id='$uid-$day_id-$type' class='$event_classes'>\n";
272
273
switch ( $type ) {
274
case 'calendar':
@@ -293,7 +300,7 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
293
$wrap = ( _mc_is_url( $details_link ) ) ? "<a href='$details_link' class='url summary$has_image'>" : '<span class="no-link">';
294
$balance = ( _mc_is_url( $details_link ) ) ? '</a>' : '</span>';
295
} else {
296
- $wrap = "<a href='#$uid-$day_id-$type-details' class='et_smooth_scroll_disabled url summary$has_image'>";
297
$balance = '</a>';
298
}
299
} else {
@@ -311,7 +318,7 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
311
$header .= '<span class="summary">' . $title . '</span>';
312
313
$close_image = apply_filters( 'mc_close_button', "<span class='dashicons dashicons-dismiss' aria-hidden='true'></span><span class='screen-reader-text'>Close</span>" );
314
- $close_button = "<button type='button' aria-controls='$uid-$day_id-$type-details' class='mc-toggle close' data-action='shiftforward'>$close_image</button>";
315
316
if ( mc_show_details( $time, $type ) ) {
317
$close = ( 'calendar' == $type || 'mini' == $type ) ? $close_button : '';
@@ -357,6 +364,12 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
357
$img = mc_get_event_image( $event, $data );
358
}
359
360
if ( 'true' == $display_desc || 'single' == $type ) {
361
$description = wpautop( stripcslashes( mc_kses_post( $event->event_desc ) ), 1 );
362
$description = "<div class='longdesc description' itemprop='description'>$description</div>";
@@ -404,6 +417,7 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
404
405
$details = "\n"
406
. $close
407
. $time_html
408
. $list_title
409
. $img
@@ -427,7 +441,7 @@ function my_calendar_draw_event( $event, $type = 'calendar', $process_date, $tim
427
}
428
429
$img_class = ( '' != $img ) ? ' has-image' : ' no-image';
430
- $container = "<div id='$uid-$day_id-$type-details' class='details$img_class' role='alert' aria-labelledby='$uid-title' itemscope itemtype='http://schema.org/Event'>\n";
431
$container .= "<meta itemprop='name' content='" . strip_tags( $event->event_title ) . "' />";
432
$container = apply_filters( 'mc_before_event', $container, $event, $type, $time );
433
$details = $header . $container . apply_filters( 'mc_inner_content', $details, $event, $type, $time );
@@ -462,7 +476,7 @@ function mc_get_details( $data, $template, $type ) {
462
switch ( $type ) {
463
case 'mini':
464
$template = mc_get_template( 'mini' );
465
- if ( 1 == ( 'mc_use_mini_template' ) ) {
466
$details = mc_draw_template( $data, $template );
467
}
468
break;
@@ -533,7 +547,7 @@ function mc_get_event_image( $event, $data ) {
533
* @return string classes
534
*/
535
function mc_event_classes( $event, $uid, $type ) {
536
- $uid = 'mc_' . $event->occur_id;
537
$ts = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $event->ts_occur_begin ) ) );
538
$end = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $event->ts_occur_end ) ) );
539
$now = current_time( 'timestamp' );
@@ -2266,19 +2280,37 @@ function mc_category_key( $category ) {
2266
}
2267
$hex = ( 0 !== strpos( $cat->category_color, '#' ) ) ? '#' : '';
2268
$class = mc_category_class( $cat, '' );
2269
- if ( isset( $_GET['mcat'] ) && $_GET['mcat'] == $cat->category_id || $category == $cat->category_id ) {
2270
- $class .= ' current';
2271
}
2272
if ( 1 == $cat->category_private ) {
2273
$class .= ' private';
2274
}
2275
$cat_name = mc_kses_post( stripcslashes( $cat->category_name ) );
2276
- $url = mc_build_url( array( 'mcat' => $cat->category_id ), array( 'mcat' ) );
2277
if ( '' != $cat->category_icon && 'true' != get_option( 'mc_hide_icons' ) ) {
2278
- $key .= '<li class="cat_' . $class . '"><a href="' . esc_url( $url ) . '" class="mcajax"><span class="category-color-sample"><img src="' . $path . $cat->category_icon . '" alt="" style="background:' . $hex . $cat->category_color . ';" /></span>' . $cat_name . '</a></li>';
2279
} else {
2280
- $key .= '<li class="cat_' . $class . '"><a href="' . esc_url( $url ) . '" class="mcajax"><span class="category-color-sample no-icon" style="background:' . $hex . $cat->category_color . ';"> &nbsp; </span>' . $cat_name . '</a></li>';
2281
}
2282
}
2283
if ( isset( $_GET['mcat'] ) ) {
2284
$key .= "<li class='all-categories'><a href='" . esc_url( mc_build_url( array(), array( 'mcat' ), mc_get_current_url() ) ) . "' class='mcajax'>" . apply_filters( 'mc_text_all_categories', __( 'All Categories', 'my-calendar' ) ) . '</a></li>';
@@ -2854,7 +2886,8 @@ function mc_get_list_locations( $datatype, $full = true, $return_type = OBJECT )
2854
} else {
2855
$select = '*';
2856
}
2857
- $locations = $mcdb->get_results( $mcdb->prepare( "SELECT DISTINCT $select FROM " . my_calendar_locations_table() . " $where ORDER BY %s ASC", $data ), $return_type );
2858
2859
return $locations;
2860
}
42
* @return string HTML output.
43
*/
44
function mc_time_html( $event, $type ) {
45
+ $orig_format = get_option( 'mc_date_format' );
46
+ $date_format = ( '' != $orig_format ) ? $orig_format : get_option( 'date_format' );
47
if ( $event->event_end != $event->event_begin ) {
48
$mult_format = get_option( 'mc_multidate_format' );
49
$mult_format = ( '' != $mult_format ) ? $mult_format : 'F j-%d, Y';
50
$date_format = str_replace( '%d', date( 'j', strtotime( $event->occur_end ) ), $mult_format );
51
}
52
+ // If this event crosses years or months, use original date format & show both dates.
53
+ if ( date( 'Y', strtotime( $event->occur_end ) ) != date( 'Y', strtotime( $event->occur_begin ) ) || date( 'm', strtotime( $event->occur_end ) ) != date( 'm', strtotime( $event->occur_begin ) ) ) {
54
+ $current = date_i18n( $orig_format, strtotime( $event->occur_begin ) ) . ' &ndash; ' . date_i18n( $orig_format, strtotime( $event->occur_end ) );
55
+ } else {
56
+ $current = date_i18n( $date_format, strtotime( $event->occur_begin ) );
57
+ }
58
$id_start = date( 'Y-m-d', strtotime( $event->occur_begin ) );
59
$id_end = date( 'Y-m-d', strtotime( $event->occur_end ) );
60
$event_date = ( 'list' == $type ) ? '' : "<span class='mc-event-date dtstart' itemprop='startDate' title='" . $id_start . 'T' . $event->event_time . "' content='" . $id_start . 'T' . $event->event_time . "'>$current</span>";
240
$description = '';
241
$link = '';
242
$vcal = '';
243
+ $inner_title = '';
244
$gcal = '';
245
$image = '';
246
$tickets = '';
267
$display_gmap = get_option( 'mc_gmap' );
268
$display_link = get_option( 'mc_event_link' );
269
$display_image = get_option( 'mc_image' );
270
+ $display_title = get_option( 'mc_title' );
271
$display_reg = get_option( 'mc_event_registration' );
272
$day_id = date( 'd', strtotime( $process_date ) );
273
+ $uid = 'mc_' . $type . '_' . $day_id . '_' . $event->occur_id;
274
$image = mc_category_icon( $event );
275
$img = '';
276
$has_image = ( '' != $image ) ? ' has-image' : '';
277
$event_classes = mc_event_classes( $event, $day_id, $type );
278
+ $header .= "<div id='$uid-$type' class='$event_classes'>\n";
279
280
switch ( $type ) {
281
case 'calendar':
300
$wrap = ( _mc_is_url( $details_link ) ) ? "<a href='$details_link' class='url summary$has_image'>" : '<span class="no-link">';
301
$balance = ( _mc_is_url( $details_link ) ) ? '</a>' : '</span>';
302
} else {
303
+ $wrap = "<a href='#$uid-$type-details' class='et_smooth_scroll_disabled url summary$has_image'>";
304
$balance = '</a>';
305
}
306
} else {
318
$header .= '<span class="summary">' . $title . '</span>';
319
320
$close_image = apply_filters( 'mc_close_button', "<span class='dashicons dashicons-dismiss' aria-hidden='true'></span><span class='screen-reader-text'>Close</span>" );
321
+ $close_button = "<button type='button' aria-controls='$uid-$type-details' class='mc-toggle close' data-action='shiftforward'>$close_image</button>";
322
323
if ( mc_show_details( $time, $type ) ) {
324
$close = ( 'calendar' == $type || 'mini' == $type ) ? $close_button : '';
364
$img = mc_get_event_image( $event, $data );
365
}
366
367
+ if ( 'calendar' == $type && 'true' == $display_title ) {
368
+ // In all cases, this is semantically a duplicate of the title, but can be beneficial for sighted users.
369
+ $headingtype = ( 'h3' == $hlevel ) ? 'h4' : 'h' . ( ( (int) str_replace( 'h', '', $hlevel ) ) - 1 );
370
+ $inner_title = '<h4 class="mc-title" aria-hidden="true">' . $event_title . '</h4>';
371
+ }
372
+
373
if ( 'true' == $display_desc || 'single' == $type ) {
374
$description = wpautop( stripcslashes( mc_kses_post( $event->event_desc ) ), 1 );
375
$description = "<div class='longdesc description' itemprop='description'>$description</div>";
417
418
$details = "\n"
419
. $close
420
+ . $inner_title
421
. $time_html
422
. $list_title
423
. $img
441
}
442
443
$img_class = ( '' != $img ) ? ' has-image' : ' no-image';
444
+ $container = "<div id='$uid-$type-details' class='details$img_class' role='alert' aria-labelledby='$uid-title' itemscope itemtype='http://schema.org/Event'>\n";
445
$container .= "<meta itemprop='name' content='" . strip_tags( $event->event_title ) . "' />";
446
$container = apply_filters( 'mc_before_event', $container, $event, $type, $time );
447
$details = $header . $container . apply_filters( 'mc_inner_content', $details, $event, $type, $time );
476
switch ( $type ) {
477
case 'mini':
478
$template = mc_get_template( 'mini' );
479
+ if ( 1 == get_option( 'mc_use_mini_template' ) ) {
480
$details = mc_draw_template( $data, $template );
481
}
482
break;
547
* @return string classes
548
*/
549
function mc_event_classes( $event, $uid, $type ) {
550
+ $uid = 'mc_' . $type . '_' . $event->occur_id;
551
$ts = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $event->ts_occur_begin ) ) );
552
$end = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $event->ts_occur_end ) ) );
553
$now = current_time( 'timestamp' );
2280
}
2281
$hex = ( 0 !== strpos( $cat->category_color, '#' ) ) ? '#' : '';
2282
$class = mc_category_class( $cat, '' );
2283
+
2284
+ $selected_categories = ( empty( $_GET['mcat'] ) ) ? array() : explode( ',', $_GET['mcat'] );
2285
+
2286
+ if ( in_array( $cat->category_id, $selected_categories ) || $category == $cat->category_id ) {
2287
+ $selected_categories = array_diff( $selected_categories, array( $cat->category_id ) );
2288
+ $class .= ' current';
2289
+ $aria_current = 'aria-current="true"';
2290
+ } else {
2291
+ $selected_categories[] = $cat->category_id;
2292
+ $aria_current = '';
2293
+ }
2294
+ $selectable_categories = implode( ',', $selected_categories );
2295
+ if ( '' == $selectable_categories ) {
2296
+ $url = remove_query_arg( 'mcat', mc_get_current_url() );
2297
+ } else {
2298
+ $url = mc_build_url( array( 'mcat' => $selectable_categories ), array( 'mcat' ) );
2299
}
2300
if ( 1 == $cat->category_private ) {
2301
$class .= ' private';
2302
}
2303
$cat_name = mc_kses_post( stripcslashes( $cat->category_name ) );
2304
+ $cat_key = '';
2305
if ( '' != $cat->category_icon && 'true' != get_option( 'mc_hide_icons' ) ) {
2306
+ $cat_key .= '<span class="category-color-sample"><img src="' . $path . $cat->category_icon . '" alt="" style="background:' . $hex . $cat->category_color . ';" /></span>' . $cat_name;
2307
+ } elseif ( 'default' != get_option( 'mc_apply_color' ) ) {
2308
+ $cat_key .= '<span class="category-color-sample no-icon" style="background:' . $hex . $cat->category_color . ';"> &nbsp; </span>' . $cat_name;
2309
} else {
2310
+ // If category colors are ignored, don't render HTML for them.
2311
+ $cat_key .= $cat_name;
2312
}
2313
+ $key .= '<li class="cat_' . $class . '"><a href="' . esc_url( $url ) . '" class="mcajax"' . $aria_current . '>' . $cat_key . '</a></li>';
2314
}
2315
if ( isset( $_GET['mcat'] ) ) {
2316
$key .= "<li class='all-categories'><a href='" . esc_url( mc_build_url( array(), array( 'mcat' ), mc_get_current_url() ) ) . "' class='mcajax'>" . apply_filters( 'mc_text_all_categories', __( 'All Categories', 'my-calendar' ) ) . '</a></li>';
2886
} else {
2887
$select = '*';
2888
}
2889
+ // Value of $data is set in switch above. $select is same as data unless *.
2890
+ $locations = $mcdb->get_results( "SELECT DISTINCT $select FROM " . my_calendar_locations_table() . " $where ORDER BY $data ASC", $return_type ); // WPCS: unprepared SQL ok.
2891
2892
return $locations;
2893
}
my-calendar-settings.php CHANGED
@@ -305,6 +305,7 @@ function my_calendar_settings() {
305
update_option( 'mc_event_link', ( ! empty( $_POST['mc_event_link'] ) && 'on' == $_POST['mc_event_link'] ) ? 'true' : 'false' );
306
update_option( 'mc_image', ( ! empty( $_POST['mc_image'] ) && 'on' == $_POST['mc_image'] ) ? 'true' : 'false' );
307
update_option( 'mc_show_weekends', ( ! empty( $_POST['mc_show_weekends'] ) && 'on' == $_POST['mc_show_weekends'] ) ? 'true' : 'false' );
308
update_option( 'mc_convert', ( ! empty( $_POST['mc_convert'] ) ) ? $_POST['mc_convert'] : 'false' );
309
if ( ( isset( $_POST['mc_use_permalinks'] ) && 'true' == get_option( 'mc_use_permalinks' ) ) && 'true' != $permalinks ) {
310
$url = admin_url( 'options-permalink.php#mc_cpt_base' );
@@ -756,6 +757,7 @@ function mc_remote_db() {
756
<legend><?php _e( 'Grid Options', 'my-calendar' ); ?></legend>
757
<ul>
758
<li><?php mc_settings_field( 'mc_show_weekends', __( 'Show Weekends on Calendar', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
759
<li>
760
<?php
761
mc_settings_field( 'mc_convert', __( 'Mobile View', 'my-calendar' ), array(
305
update_option( 'mc_event_link', ( ! empty( $_POST['mc_event_link'] ) && 'on' == $_POST['mc_event_link'] ) ? 'true' : 'false' );
306
update_option( 'mc_image', ( ! empty( $_POST['mc_image'] ) && 'on' == $_POST['mc_image'] ) ? 'true' : 'false' );
307
update_option( 'mc_show_weekends', ( ! empty( $_POST['mc_show_weekends'] ) && 'on' == $_POST['mc_show_weekends'] ) ? 'true' : 'false' );
308
+ update_option( 'mc_title', ( ! empty( $_POST['mc_title'] ) && 'on' == $_POST['mc_title'] ) ? 'true' : 'false' );
309
update_option( 'mc_convert', ( ! empty( $_POST['mc_convert'] ) ) ? $_POST['mc_convert'] : 'false' );
310
if ( ( isset( $_POST['mc_use_permalinks'] ) && 'true' == get_option( 'mc_use_permalinks' ) ) && 'true' != $permalinks ) {
311
$url = admin_url( 'options-permalink.php#mc_cpt_base' );
757
<legend><?php _e( 'Grid Options', 'my-calendar' ); ?></legend>
758
<ul>
759
<li><?php mc_settings_field( 'mc_show_weekends', __( 'Show Weekends on Calendar', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
760
+ <li><?php mc_settings_field( 'mc_title', __( 'Include event title in details pop-up', 'my-calendar' ), '', '', array(), 'checkbox-single' ); ?></li>
761
<li>
762
<?php
763
mc_settings_field( 'mc_convert', __( 'Mobile View', 'my-calendar' ), array(
my-calendar-templates.php CHANGED
@@ -288,7 +288,7 @@ function mc_hcard( $event, $address = 'true', $map = 'true', $source = 'event' )
288
$hcard .= ( '' != $street ) ? '<div class="street-address" itemprop="streetAddress">' . $street . '</div>' : '';
289
$hcard .= ( '' != $street2 ) ? '<div class="street-address" itemprop="streetAddress">' . $street2 . '</div>' : '';
290
$hcard .= ( '' != $city . $state . $zip ) ? '<div>' : '';
291
- $hcard .= ( '' != $city ) ? '<span class="locality" itemprop="addressLocality">' . $city . '</span><span class="sep">, </span>' : '';
292
$hcard .= ( '' != $state ) ? '<span class="region" itemprop="addressRegion">' . $state . '</span> ' : '';
293
$hcard .= ( '' != $zip ) ? ' <span class="postal-code" itemprop="postalCode">' . $zip . '</span>' : '';
294
$hcard .= ( '' != $city . $state . $zip ) ? '</div>' : '';
288
$hcard .= ( '' != $street ) ? '<div class="street-address" itemprop="streetAddress">' . $street . '</div>' : '';
289
$hcard .= ( '' != $street2 ) ? '<div class="street-address" itemprop="streetAddress">' . $street2 . '</div>' : '';
290
$hcard .= ( '' != $city . $state . $zip ) ? '<div>' : '';
291
+ $hcard .= ( '' != $city ) ? '<span class="locality" itemprop="addressLocality">' . $city . '</span><span class="mc-sep">, </span>' : '';
292
$hcard .= ( '' != $state ) ? '<span class="region" itemprop="addressRegion">' . $state . '</span> ' : '';
293
$hcard .= ( '' != $zip ) ? ' <span class="postal-code" itemprop="postalCode">' . $zip . '</span>' : '';
294
$hcard .= ( '' != $city . $state . $zip ) ? '</div>' : '';
my-calendar.php CHANGED
@@ -17,7 +17,7 @@
17
* License: GPL-2.0+
18
* License URI: http://www.gnu.org/license/gpl-2.0.txt
19
* Domain Path: lang
20
- * Version: 3.0.11
21
*/
22
23
/*
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
}
43
44
global $mc_version, $wpdb;
45
- $mc_version = '3.0.11';
46
47
define( 'MC_DEBUG', false );
48
@@ -144,8 +144,10 @@ add_action( 'init', 'mc_custom_canonical' );
144
* Customize canonical URL for My Calendar custom links
145
*/
146
function mc_custom_canonical() {
147
- add_action( 'wp_head', 'mc_canonical' );
148
- remove_action( 'wp_head', 'rel_canonical' );
149
}
150
151
/**
@@ -205,7 +207,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
205
}
206
}
207
if ( ! $remove ) {
208
- if ( ! function_exists( 'mcs_submit_exists' ) ) {
209
?>
210
<div class="ui-sortable meta-box-sortables">
211
<div class="postbox sell support">
@@ -242,7 +244,7 @@ function mc_show_sidebar( $show = '', $add = false, $remove = false ) {
242
</div>
243
<?php
244
}
245
- if ( ! function_exists( 'mcs_submit_exists' ) ) {
246
?>
247
<div class="ui-sortable meta-box-sortables">
248
<div class="postbox support">
17
* License: GPL-2.0+
18
* License URI: http://www.gnu.org/license/gpl-2.0.txt
19
* Domain Path: lang
20
+ * Version: 3.0.17
21
*/
22
23
/*
42
}
43
44
global $mc_version, $wpdb;
45
+ $mc_version = '3.0.17';
46
47
define( 'MC_DEBUG', false );
48
144
* Customize canonical URL for My Calendar custom links
145
*/
146
function mc_custom_canonical() {
147
+ if ( isset( $_GET['mc_id'] ) ) {
148
+ add_action( 'wp_head', 'mc_canonical' );
149
+ remove_action( 'wp_head', 'rel_canonical' );
150
+ }
151
}
152
153
/**
207
}
208
}
209
if ( ! $remove ) {
210
+ if ( ! function_exists( 'mcs_submissions' ) ) {
211
?>
212
<div class="ui-sortable meta-box-sortables">
213
<div class="postbox sell support">
244
</div>
245
<?php
246
}
247
+ if ( ! function_exists( 'mcs_submissions' ) ) {
248
?>
249
<div class="ui-sortable meta-box-sortables">
250
<div class="postbox support">
readme.txt CHANGED
@@ -1,1045 +1,305 @@
1
- === My Calendar ===
2
- Contributors: joedolson
3
- Donate link: http://www.joedolson.com/donate/
4
- Tags: calendar, dates, times, event, events, scheduling, schedule, event manager, event calendar, class, concert, venue, location, box office, tickets, registration
5
- Requires at least: 4.4
6
- Tested up to: 4.9
7
- Requires PHP: 5.3
8
- Stable tag: 3.0.11
9
- Text domain: my-calendar
10
- License: GPLv2 or later
11
-
12
- Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
13
-
14
- == Description ==
15
-
16
- My Calendar does WordPress event management with richly customizable ways to display events. The plug-in supports individual event calendars within WordPress Multisite, multiple calendars displayed by categories, locations or author, or simple lists of upcoming events.
17
-
18
- Easy to use for anybody, My Calendar provides enormous flexibility for designers and developers needing a custom calendar. My Calendar is built with accessibility in mind, so all your users can get equal access and experience in your calendar.
19
-
20
- = Premium Event Management =
21
- Looking for more? [Buy My Calendar Pro](https://www.joedolson.com/my-calendar/pro/), the premium extension for My Calendar to add support for user-submitted events, integration between posting and event creation, and import events from outside sources.
22
-
23
- = Selling event tickets? =
24
- Do you need to sell tickets for events? [Use My Tickets](https://wordpress.org/plugins/my-tickets/) and sell tickets for your My Calendar events. Set prices, ticket availability, and sell multiple events at the same time using My Tickets.
25
-
26
- = Features: =
27
-
28
- * Calendar grid and list views of events
29
- * Monthly, weekly, or daily view.
30
- * Mini-calendar for compact displays (as widget or as shortcode)
31
- * Widgets: today's events, upcoming events, compact calendar, event search
32
- * Custom templates for event output
33
- * Limit views by categories, location, author, or host
34
- * Editable CSS styles and JavaScript behaviors
35
- * Schedule recurring events.
36
- * Edit single occurrences of recurring events
37
- * Rich permissions handling to restrict access to parts of My Calendar
38
- * Email notification to administrator when events are scheduled or reserved
39
- * Post to Twitter when events are created (using [WP to Twitter](http://wordpress.org/extend/plugins/wp-to-twitter/))
40
- * Managing locations
41
- * Fetch events from a remote database. (Sharing events in a network of sites.)
42
- * Multisite-friendly
43
- * Integrated help page
44
- * Shortcode Generator to create customized views of My Calendar
45
-
46
- = What's in My Calendar Pro? =
47
-
48
- > * Let your site visitors submit events to your site (pay to post or free!).
49
- > * Let logged-in users edit their events from the front-end.
50
- > * Create events when you publish a blog post
51
- > * Publish a blog post when you create an event
52
- > * Advanced search features
53
- > * Responsive mode
54
- > * Import events from .ics or .csv formats via file or URL.
55
-
56
- = Translations =
57
-
58
- Visit [Wordpress Translations](https://translate.wordpress.org/projects/wp-plugins/my-calendar) to check progress or contribute to your language.
59
-
60
- Translating my plug-ins is always appreciated. Visit <a href="https://translate.wordpress.org/projects/wp-plugins/my-calendar">WordPress translations</a> to help get your language to 100%!
61
-
62
- == Installation ==
63
-
64
- 1. Upload the `/my-calendar/` directory into your WordPress plugins directory.
65
-
66
- 2. Activate the plugin on your WordPress plugins page
67
-
68
- 3. Configure My Calendar using the settings pages in the admin panel:
69
-
70
- My Calendar -> Add New Event
71
- My Calendar -> Manage Events
72
- My Calendar -> Event Groups
73
- My Calendar -> Add New Location
74
- My Calendar -> Manage Locations
75
- My Calendar -> Manage Categories
76
- My Calendar -> Style Editor
77
- My Calendar -> Script Manager
78
- My Calendar -> Template Editor
79
- My Calendar -> Settings
80
- My Calendar -> Help
81
-
82
- 4. Visit My Calendar -> Help for assistance with shortcode options or widget configuration.
83
-
84
- == Changelog ==
85
-
86
- = 3.0.11 =
87
-
88
- * SECURITY: XSS - Canonical URL not properly sanitized. Affects 3.0.0 and up.
89
-
90
- = 3.0.10 =
91
-
92
- * Bug fix: invalid method used to sort location lists.
93
- * Bug fix: shortcode generator missing input value
94
- * Bug fix: datepicker did not reflect start of week settings
95
- * Stylesheet CSS change
96
-
97
- = 3.0.9 =
98
-
99
- * Bug fix: Error thrown if Akismet had previously been configured, then deleted.
100
- * Bug fix: location type was added to params if category key was set.
101
- * Bug fix: remove a couple notices
102
- * Bug fix: category relationships not carried over when recurring events split
103
-
104
- = 3.0.8 =
105
-
106
- * Bug fix: need to allow <a> elements in mc_strip_tags so calendar linkscan point to non-calendar URLs
107
-
108
- = 3.0.7 =
109
-
110
- * Bug fix: Case where events ending at midnight (AM) of current day were displayed
111
- * Bug fix: trim spaces from values earlier when parsing filter elements
112
- * Change: don't declare font-family in older stylesheets.
113
-
114
- = 3.0.6 =
115
-
116
- * Bug fix: Shortcode for locations forms always rendered as if in a group filter.
117
- * Bug fix: If the default length 1 hr event pushes into next day, adjust length.
118
- * Bug fix: Incorrectly nested parentheses caused math error in months-by-day recurrence
119
-
120
- = 3.0.5 =
121
-
122
- * Bug fix: If only one event on a day, event title did not show in list view with show title option.
123
- * Bug fix: Incorrect array key for fallback parameter in widget
124
- * Bug fix: custom template query expected 25 chars instead of 32
125
- * Re-allow <br> in event titles.
126
-
127
- = 3.0.4 =
128
-
129
- * Bug fix: aria-current test was broken for current date
130
- * Bug fix: Private categories not disambiguated in MySQL query when excluded
131
- * Improve: Rewrite my_calendar_copyr backup functions to use WP core functions.
132
-
133
- = 3.0.3 =
134
-
135
- * Bug fix: Category key needed to use a 'WHERE' not an 'AND'; broke output if limiting by category
136
- * Bug fix: Error thrown in style editor & category editor if custom directory did not exist
137
-