The Events Calendar Shortcode - Version 1.9

Version Description

  • Adds check for minimum WordPress and PHP version
  • Adds a link to a short tutorial video
  • Changes first example shortcode so it's easier to copy/paste
Download this release

Release Info

Developer brianhogg
Plugin Icon 128x128 The Events Calendar Shortcode
Version 1.9
Comparing to
See all releases

Code changes from version 1.8 to 1.9

includes/wp-requirements.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Requirements
4
+ *
5
+ * Utility to check current PHP version, WordPress version and PHP extensions.
6
+ *
7
+ * @package WP_Requirements
8
+ * @version 1.4.0
9
+ * @author Fulvio Notarstefano <fulvio.notarstefano@gmail.com>
10
+ * @link https://github.com/nekojira/wp-requirements
11
+ * @license GPL2+
12
+ */
13
+
14
+ if ( ! class_exists( 'TECS_WP_Requirements' ) ) {
15
+
16
+ class TECS_WP_Requirements {
17
+
18
+ /**
19
+ * Plugin name.
20
+ *
21
+ * @access private
22
+ * @var string
23
+ */
24
+ private $name = '';
25
+
26
+ /**
27
+ * Plugin main file.
28
+ *
29
+ * plugin_basename( __FILE__ )
30
+ *
31
+ * @access private
32
+ * @var string
33
+ */
34
+ private $plugin = '';
35
+
36
+ /**
37
+ * WordPress.
38
+ *
39
+ * @access private
40
+ * @var bool
41
+ */
42
+ private $wp = true;
43
+
44
+ /**
45
+ * PHP.
46
+ *
47
+ * @access private
48
+ * @var bool
49
+ */
50
+ private $php = true;
51
+
52
+ /**
53
+ * PHP Extensions.
54
+ *
55
+ * @access private
56
+ * @var bool
57
+ */
58
+ private $extensions = true;
59
+
60
+ /**
61
+ * Requirements to check.
62
+ *
63
+ * @access private
64
+ * @var array
65
+ */
66
+ private $requirements = array();
67
+
68
+ /**
69
+ * Results failures.
70
+ *
71
+ * Associative array with requirements results.
72
+ *
73
+ * @access private
74
+ * @var array
75
+ */
76
+ private $failures = array();
77
+
78
+ /**
79
+ * Admin notice.
80
+ *
81
+ * @access private
82
+ * @var string
83
+ */
84
+ private $notice = '';
85
+
86
+ /**
87
+ * Run checks.
88
+ *
89
+ * @param string $name The plugin name.
90
+ * @param string $plugin Output of `plugin_basename( __FILE__ )`.
91
+ * @param array $requirements Associative array with requirements.
92
+ */
93
+ public function __construct( $name, $plugin, $requirements ) {
94
+
95
+ $this->name = htmlspecialchars( strip_tags( $name ) );
96
+ $this->plugin = $plugin;
97
+ $this->requirements = $requirements;
98
+
99
+ if ( ! empty( $requirements ) && is_array( $requirements ) ) {
100
+
101
+ $failures = $extensions = array();
102
+
103
+ $requirements = array_merge(
104
+ array(
105
+ 'WordPress' => '',
106
+ 'PHP' => '',
107
+ 'Extensions' => '',
108
+ ), $requirements
109
+ );
110
+
111
+ // Check for WordPress version.
112
+ if ( $requirements['WordPress'] && is_string( $requirements['WordPress'] ) ) {
113
+ if ( function_exists( 'get_bloginfo' ) ) {
114
+ $wp_version = get_bloginfo( 'version' );
115
+ if ( version_compare( $wp_version, $requirements['WordPress'] ) === - 1 ) {
116
+ $failures['WordPress'] = $wp_version;
117
+ $this->wp = false;
118
+ }
119
+ }
120
+ }
121
+
122
+ // Check fo PHP version.
123
+ if ( $requirements['PHP'] && is_string( $requirements['PHP'] ) ) {
124
+ if ( version_compare( PHP_VERSION, $requirements['PHP'] ) === -1 ) {
125
+ $failures['PHP'] = PHP_VERSION;
126
+ $this->php = false;
127
+ }
128
+ }
129
+
130
+ // Check fo PHP Extensions.
131
+ if ( $requirements['Extensions'] && is_array( $requirements['Extensions'] ) ) {
132
+ foreach ( $requirements['Extensions'] as $extension ) {
133
+ if ( $extension && is_string( $extension ) ) {
134
+ $extensions[ $extension ] = extension_loaded( $extension );
135
+ }
136
+ }
137
+ if ( in_array( false, $extensions ) ) {
138
+ foreach ( $extensions as $extension_name => $found ) {
139
+ if ( $found === false ) {
140
+ $failures['Extensions'][ $extension_name ] = $extension_name;
141
+ }
142
+ }
143
+ $this->extensions = false;
144
+ }
145
+ }
146
+
147
+ $this->failures = $failures;
148
+
149
+ } else {
150
+
151
+ trigger_error( 'WP Requirements: the requirements are invalid.', E_USER_ERROR );
152
+
153
+ }
154
+ }
155
+
156
+ /**
157
+ * Get requirements results.
158
+ *
159
+ * @return array
160
+ */
161
+ public function failures() {
162
+ return $this->failures;
163
+ }
164
+
165
+ /**
166
+ * Check if versions check pass.
167
+ *
168
+ * @return bool
169
+ */
170
+ public function pass() {
171
+ if ( in_array( false, array(
172
+ $this->wp,
173
+ $this->php,
174
+ $this->extensions,
175
+ ) ) ) {
176
+ return false;
177
+ }
178
+ return true;
179
+ }
180
+
181
+ /**
182
+ * Notice message.
183
+ *
184
+ * @param string $message An additional message.
185
+ *
186
+ * @return string
187
+ */
188
+ public function get_notice( $message = '' ) {
189
+
190
+ $notice = '';
191
+ $name = $this->name;
192
+ $failures = $this->failures;
193
+
194
+ if ( ! empty( $failures ) && is_array( $failures ) ) {
195
+
196
+ $notice = '<div class="error">' . "\n";
197
+ $notice .= "\t" . '<p>' . "\n";
198
+ $notice .= '<strong>' . sprintf( '%s could not be activated.', $name ) . '</strong><br>';
199
+
200
+ foreach ( $failures as $requirement => $found ) {
201
+
202
+ $required = $this->requirements[ $requirement ];
203
+
204
+ if ( 'Extensions' == $requirement ) {
205
+ if ( is_array( $found ) ) {
206
+ $notice .= sprintf(
207
+ 'Required PHP Extension(s) not found: %s.',
208
+ join( ', ', $found )
209
+ ) . '<br>';
210
+ }
211
+ } else {
212
+ $notice .= sprintf(
213
+ 'Required %1$s version: %2$s - Version found: %3$s',
214
+ $requirement,
215
+ $required,
216
+ $found
217
+ ) . '<br>';
218
+ }
219
+
220
+ }
221
+
222
+ $notice .= '<em>' . sprintf( 'Please update to meet %s requirements.', $name ) . '</em>' . "\n";
223
+ $notice .= "\t" . '</p>' . "\n";
224
+ if ( $message ) {
225
+ $notice .= $message;
226
+ }
227
+ $notice .= '</div>';
228
+ }
229
+
230
+ return $notice;
231
+ }
232
+
233
+ /**
234
+ * Print notice.
235
+ */
236
+ public function print_notice() {
237
+ echo $this->notice;
238
+ }
239
+
240
+ /**
241
+ * Deactivate plugin.
242
+ */
243
+ public function deactivate_plugin() {
244
+ if ( function_exists( 'deactivate_plugins' ) && function_exists( 'plugin_basename' ) ) {
245
+ deactivate_plugins( $this->plugin );
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Deactivate plugin and display admin notice.
251
+ *
252
+ * @param string $message An additional message in notice.
253
+ */
254
+ public function halt( $message = '' ) {
255
+
256
+ $this->notice = $this->get_notice( $message );
257
+
258
+ if ( $this->notice && function_exists( 'add_action' ) ) {
259
+
260
+ add_action( 'admin_notices', array( $this, 'print_notice' ) );
261
+ add_action( 'admin_init', array( $this, 'deactivate_plugin' ) );
262
+
263
+ if ( isset( $_GET['activate'] ) ) {
264
+ unset( $_GET['activate'] );
265
+ }
266
+ }
267
+ }
268
+
269
+ }
270
+
271
+ }
readme.txt CHANGED
@@ -1,328 +1,338 @@
1
- === The Events Calendar Shortcode ===
2
- Contributors: brianhogg
3
- Tags: event, events, calendar, shortcode, modern tribe
4
- Requires at least: 4.1
5
- Tested up to: 4.9
6
- Stable tag: 1.8
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- Adds shortcode functionality to The Events Calendar Plugin (Free Version) by Modern Tribe, so you can list your events anywhere.
11
-
12
- == Description ==
13
-
14
- This plugin adds a shortcode for use with The Events Calendar Plugin (by Modern Tribe).
15
-
16
- With this plugin, just add the shortcode on a page to display a list of your events. For example to show next 8 events in the category festival:
17
-
18
- `[ecs-list-events cat="festival" limit="8"]`
19
-
20
- = Shortcode Options: =
21
- * Basic shortcode: `[ecs-list-events]`
22
- * cat - Represents single event category. `[ecs-list-events cat='festival']` Use commas when you want multiple categories `[ecs-list-events cat='festival, workshops']`
23
- * limit - Total number of events to show. Default is 5. `[ecs-list-events limit='3']`
24
- * order - Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date. `[ecs-list-events order='DESC']`
25
- * date - To show or hide date. Value can be 'true' or 'false'. Default is true. `[ecs-list-events eventdetails='false']`
26
- * venue - To show or hide the venue. Value can be 'true' or 'false'. Default is false. `[ecs-list-events venue='true']`
27
- * excerpt - To show or hide the excerpt and set excerpt length. Default is false.
28
- * `[ecs-list-events excerpt='true']` //displays excerpt with length 100
29
- * `[ecs-list-events excerpt='300']` //displays excerpt with length 300
30
- * thumb - To show or hide thumbnail image. Default is false. `[ecs-list-events thumb='true']` //displays post thumbnail in default thumbnail dimension from media settings.
31
- * You can use thumbwidth and thumbheight to customize the thumbnail size `[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']` or thumbsize for a registered WordPress size `[ecs-list-events thumb='true' thumbsize='large']`
32
- * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
33
- * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
34
- * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
35
- * month - Show only specific Month. Type `'current'` for displaying current month only or `'next'` for next month `[ecs-list-events cat='festival' month='2015-06']`
36
- * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
37
- * key - Hide the event when the start date/time has passed `[ecs-list-events cat='festival' key='start date']`
38
- * orderby - Order by end date `[ecs-list-events orderby='enddate']`
39
-
40
- <blockquote>
41
- <h4>Additional options and benefits in the pro version</h4>
42
- <ul>
43
- <li>design - Shows <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-design&utm_content=description#designs" target="_blank">improved design by default</a>, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show events horizontally in columns, or 'grouped' to group events by day</li>
44
- <li>days - Specify how many days in the future, for example [ecs-list-events days="1"] for one day or [ecs-list-events days="7"] for one week</li>
45
- <li>date - Show only events for a specific day [ecs-list-events date='2017-04-16']</li>
46
- <li>tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.</li>
47
- <li>city, state, country - Display events by location.</li>
48
- <li>featured only - Show only events marked as "featured"</li>
49
- <li>id - Show a single event, useful for displaying details of the event on a blog post or page</li>
50
- <li>description - Use the full description instead of the excerpt of an event in the listing</li>
51
- <li>raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description</li>
52
- <li>raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt</li>
53
- <li>year - Show only events for a specific year</li>
54
- <li>date range - Show only events between certain days</li>
55
- <li>timeonly - To show just the start time of the event. [ecs-list-events timeonly='true']</li>
56
- <li>offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns</li>
57
- <li>custom design - Create one or more of your own templates for use with the shortcode</li>
58
- <li>hiderecurring - To only show the first instance of a recurring event, set to 'true'</li>
59
- </ul>
60
- <p><a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme&utm_content=description">View more Pro features</a></p>
61
- </blockquote>
62
-
63
- This plugin is not developed by or affiliated with The Events Calendar or Modern Tribe in any way.
64
-
65
- == Installation ==
66
-
67
- 1. Install The Events Calendar Shortcode Plugin from the WordPress.org repository or by uploading the-events-calendar-shortcode folder to the /wp-content/plugins directory. You must also install The Event Calendar Plugin by Modern Tribe and add your events to the calendar.
68
-
69
- 2. Activate the plugin through the Plugins menu in WordPress
70
-
71
- 3. If you don't already have The Events Calendar (the calendar you add your events to) you will be prompted to install it
72
-
73
- You can then add the `[ecs-list-events]` shortcode to the page or post you want to list events on. [Full list of options available in the documentation](https://eventcalendarnewsletter.com/events-calendar-shortcode-pro-options/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-install-docs&utm_content=description).
74
-
75
-
76
- == Frequently Asked Questions ==
77
-
78
- = What are the shortcode options? =
79
-
80
- * Basic shortcode: `[ecs-list-events]`
81
- * cat - Show events from an event category `[ecs-list-events cat='festival']` or specify multiple categories `[ecs-list-events cat='festival, workshops']`
82
- * limit - Total number of events to show. Default is 5. `[ecs-list-events limit='3']`
83
- * order - Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date. `[ecs-list-events order='DESC']`
84
- * date - To show or hide date. Value can be 'true' or 'false'. Default is true. `[ecs-list-events eventdetails='false']`
85
- * venue - To show or hide the venue. Value can be 'true' or 'false'. Default is false. `[ecs-list-events venue='true']`
86
- * excerpt - To show or hide the excerpt and set excerpt length. Default is false. `[ecs-list-events excerpt='true']` //displays excerpt with length 100
87
- excerpt='300' //displays excerpt with length 300
88
- * thumb - To show or hide thumbnail image. Default is false. `[ecs-list-events thumb='true']` //displays post thumbnail in default thumbnail dimension from media settings.
89
- * thumbsize - Specify the size of the thumbnail. `[ecs-list-events thumb='true' thumbsize='large']`
90
- * thumbwidth / thumbheight - Customize the thumbnail size in pixels `[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']`
91
- * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
92
- * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
93
- * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
94
- * month - Show only specific month (in YYYY-MM format). Type `'current'` for displaying current month only or `'next'` for next month. `[ecs-list-events cat='festival' month='2015-06']`
95
- * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
96
- * key - Hide events when the start date has passed `[ecs-list-events cat='festival' key='start date']`
97
- * orderby - Change the ordering to the end date `[ecs-list-events orderby="enddate"]`
98
-
99
- With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options&utm_content=description) you also get the following options:
100
-
101
- * design - Shows improved design by default. Set to 'standard' for the regular one, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show a horizontal/columns/photo view, or 'grouped' to group events by day
102
- * days - Specify how many days in the future, for example `[ecs-list-events days="1"]` for one day or `[ecs-list-events days="7"]` for one week
103
- * tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.
104
- * id - Show a single event, useful for displaying details of the event on a blog post or page
105
- * location (city, state/province, country) - Display events by location. Use commas when you want to include events from multiple (ie. country='United States, Canada')
106
- * description - Use the full description instead of the excerpt of an event in the listing
107
- * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
108
- * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
109
- * featured only - Show only events marked as "featured"
110
- * date - Show only events for a specific day `[ecs-list-events date='2017-04-16']`
111
- * year - Show only events for a specific year `[ecs-list-events year='2017']`
112
- * date range - Show only events between certain days `[ecs-list-events fromdate='2017-05-31' todate='2017-06-15']`
113
- * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
114
- * offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns
115
- * custom design - Create one or more of your own templates for use with the shortcode
116
- * hiderecurring - To only show the first instance of a recurring event, set to 'true'
117
-
118
- [Get The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options-bottom&utm_content=description)
119
-
120
- = How do I use this shortcode in a widget? =
121
-
122
- You can put the shortcode in a text widget, though not all themes support use of a shortcode in a widget.
123
-
124
- If a regular text widget doesn't work, put the shortcode in a <a href="https://wordpress.org/plugins/black-studio-tinymce-widget/">Visual Editor Widget</a>.
125
-
126
- = What are the classes for styling the list of events? =
127
-
128
- By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling with a bit of CSS.
129
-
130
- * ul class="ecs-event-list"
131
- * li class="ecs-event" and "ecs-featured-event" (if featured)
132
- * event title link is H4 class="entry-title summary"
133
- * date class is time
134
- * venue class is venue
135
- * span .ecs-all-events
136
- * p .ecs-excerpt
137
-
138
- Want a better looking design without knowing any CSS? Check out [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-design&utm_content=description)
139
-
140
- = How do I include a list of events in a page template? =
141
-
142
- `include echo do_shortcode("[ecs-list-events]");`
143
-
144
- Put this in the template where you want the events list to display.
145
-
146
- = How do I include a monthly calendar view instead of a list? =
147
-
148
- The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-calendar&utm_content=description) has the option to put `design="calendar"` in the shortcode to show a calendar view of the events you want.
149
-
150
- == Screenshots ==
151
-
152
- 1. After adding the plugin, add the shortcode where you want the list of events to appear in the page
153
- 2. Events will appear in a list
154
- 3. Many settings you can use in the shortcode to change what details appear in the events listing
155
-
156
- == Upgrade Notice ==
157
-
158
- = 1.8 =
159
- * Adds new orderby='title' option
160
- * Fixes resetting the WordPress global query instead of just the post data
161
-
162
- = 1.7.3 =
163
- * Hide the "at" when using venue='true' and an event has no venue
164
- * Adds additional WordPress filters to hide certain events
165
-
166
- = 1.7.2 =
167
- * Adds the ability to use schema='false' in the shortcode to hide the schema output
168
-
169
- = 1.7.1 =
170
- * Fix for month option where there's an all-day event the first day of the next month
171
- * Fix for "There are no events" string not being translated automatically into other languages
172
-
173
- = 1.7 =
174
- * Adds structured data to the shortcode output (great for SEO and people finding your events)
175
-
176
- = 1.6.1 =
177
- * Added ecs-featured-event class if event is featured
178
- * Internal changes to filtering by one or more categories
179
-
180
- = 1.6 =
181
- * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
182
-
183
- = 1.5.3 =
184
- * Fixes translation of the "View all events" link into other languages
185
- * Adds orderby parameter to order by start date, but still show events until the end date has passed
186
-
187
- = 1.5.2 =
188
- * Adds 'next' option for showing the next month of events
189
-
190
- = 1.5.1 =
191
- * Adds thumbsize option (ie. medium, large, thumbnail, full)
192
-
193
- = 1.5 =
194
- * Adds ability to translate the plugin into local languages
195
- * Additional description of options
196
-
197
- = 1.4.2 =
198
- * Additional filter for changing the link for an event
199
- * Adds category CSS classes for each event, so you can format each category differently
200
-
201
- = 1.4.1 =
202
- * Additional filters for formatting a single event
203
-
204
- = 1.4 =
205
- * Checks for whether The Events Calendar is installed
206
- * Additional filters
207
- * Improved design of shortcode help page
208
-
209
- = 1.3 =
210
- * Fixes issue with "viewall" showing the events twice
211
- * Fixes time zone issue by using current_time() instead of date()
212
- * Hides events that are marked 'hide from listing'
213
- * Switches to tribe_get_events() to get the events
214
- * Removes the ... from the end of the excerpt if less than the excerpt length
215
- * Adds date_thumb option
216
- * Adds additional filters
217
-
218
- = 1.2 =
219
- * Updates author/description (Event Calendar Newsletter / Brian Hogg Consulting)
220
-
221
- = 1.0.11 =
222
- Add Link to Thumbnail
223
- merge pull request from d4mation -Replaced extracted variables with $atts as using extract was deprecated
224
- =1.0.10 =
225
- Minor Error Change - fix name and slug
226
- = 1.0.9 =
227
- Minor Error Change - Multiple Categories
228
- = 1.0.8 =
229
- Add options : multi-categories - Thanks to sujin2f
230
- = 1.0.7 =
231
- Add options : contentorder, month, past, key - Thanks to sujin2f
232
- = 1.0.6 =
233
- Fix missing ul
234
- = 1.0.5 =
235
- * Add excerpt and thumbnail - Thanks to ankitpokhrel
236
- = 1.0.2 =
237
- * Add venue to shortcode - Thanks to ankitpokhrel
238
- = 1.0.1 =
239
- * Fix Firefox browser compatibility issue
240
- = 1 =
241
- * Initial Release
242
-
243
- == Changelog ==
244
-
245
- = 1.8 =
246
- * Adds new orderby='title' option
247
- * Fixes resetting the WordPress global query instead of just the post data
248
-
249
- = 1.7.3 =
250
- * Hide the "at" when using venue='true' and an event has no venue
251
- * Adds additional WordPress filters to hide certain events
252
-
253
- = 1.7.2 =
254
- * Adds the ability to use schema='false' in the shortcode to hide the schema output
255
-
256
- = 1.7.1 =
257
- * Fix for month option where there's an all-day event the first day of the next month
258
- * Fix for "There are no events" string not being translated automatically into other languages
259
-
260
- = 1.7 =
261
- * Adds structured data to the shortcode output (great for SEO and people finding your events)
262
-
263
- = 1.6.1 =
264
- * Added ecs-featured-event class if event is featured
265
- * Internal changes to filtering by one or more categories
266
-
267
- = 1.6 =
268
- * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
269
-
270
- = 1.5.3 =
271
- * Fixes translation of the "View all events" link into other languages
272
- * Adds orderby parameter to order by start date, but still show events until the end date has passed
273
-
274
- = 1.5.2 =
275
- * Adds 'next' option for showing the next month of events
276
-
277
- = 1.5.1 =
278
- * Adds thumbsize option (ie. medium, large, thumbnail, full)
279
-
280
- = 1.5 =
281
- * Adds ability to translate the plugin into local languages
282
- * Additional description of options
283
-
284
- = 1.4.2 =
285
- * Additional filter for changing the link for an event
286
- * Adds category CSS classes for each event, so you can format each category differently
287
-
288
- = 1.4.1 =
289
- * Additional filters for formatting a single event
290
-
291
- = 1.4 =
292
- * Checks for whether The Events Calendar is installed
293
- * Additional filters
294
- * Improved design of shortcode help page
295
-
296
- = 1.3 =
297
- * Fixes issue with "viewall" showing the events twice
298
- * Fixes time zone issue by using current_time() instead of date()
299
- * Hides events that are marked 'hide from listing'
300
- * Switches to tribe_get_events() to get the events
301
- * Removes the ... from the end of the excerpt if less than the excerpt length
302
- * Adds date_thumb option
303
- * Adds additional filters
304
-
305
- = 1.2 =
306
- * Updates author/description (Event Calendar Newsletter / Brian Hogg Consulting)
307
-
308
- = 1.0.11 =
309
- Add Link to Thumbnail
310
- merge pull request from d4mation -Replaced extracted variables with $atts as using extract was deprecated
311
- =1.0.10 =
312
- Minor Error Change - fix name and slug
313
- = 1.0.9 =
314
- Minor Error Change - Multiple Categories
315
- = 1.0.8 =
316
- Add options : multi-categories - Thanks to sujin2f
317
- = 1.0.7 =
318
- Add options : contentorder, month, past, key - Thanks to sujin2f
319
- = 1.0.6 =
320
- Fix missing ul
321
- = 1.0.5 =
322
- * Add excerpt and thumbnail - Thanks to ankitpokhrel
323
- = 1.0.2 =
324
- * Add venue to shortcode - Thanks to ankitpokhrel
325
- = 1.0.1 =
326
- * Fix Firefox browser compatibility issue
327
- = 1 =
328
- * Initial Release
 
 
 
 
 
 
 
 
 
 
1
+ === The Events Calendar Shortcode ===
2
+ Contributors: brianhogg
3
+ Tags: event, events, calendar, shortcode, modern tribe
4
+ Requires at least: 4.1
5
+ Tested up to: 4.9
6
+ Stable tag: 1.9
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Adds shortcode functionality to The Events Calendar Plugin (Free Version) by Modern Tribe, so you can list your events anywhere.
11
+
12
+ == Description ==
13
+
14
+ This plugin adds a shortcode for use with The Events Calendar Plugin (by Modern Tribe).
15
+
16
+ With this plugin, just add the shortcode on a page to display a list of your events. For example to show next 8 events in the category festival:
17
+
18
+ `[ecs-list-events cat="festival" limit="8"]`
19
+
20
+ = Shortcode Options: =
21
+ * Basic shortcode: `[ecs-list-events]`
22
+ * cat - Represents single event category. `[ecs-list-events cat='festival']` Use commas when you want multiple categories `[ecs-list-events cat='festival, workshops']`
23
+ * limit - Total number of events to show. Default is 5. `[ecs-list-events limit='3']`
24
+ * order - Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date. `[ecs-list-events order='DESC']`
25
+ * date - To show or hide date. Value can be 'true' or 'false'. Default is true. `[ecs-list-events eventdetails='false']`
26
+ * venue - To show or hide the venue. Value can be 'true' or 'false'. Default is false. `[ecs-list-events venue='true']`
27
+ * excerpt - To show or hide the excerpt and set excerpt length. Default is false.
28
+ * `[ecs-list-events excerpt='true']` //displays excerpt with length 100
29
+ * `[ecs-list-events excerpt='300']` //displays excerpt with length 300
30
+ * thumb - To show or hide thumbnail image. Default is false. `[ecs-list-events thumb='true']` //displays post thumbnail in default thumbnail dimension from media settings.
31
+ * You can use thumbwidth and thumbheight to customize the thumbnail size `[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']` or thumbsize for a registered WordPress size `[ecs-list-events thumb='true' thumbsize='large']`
32
+ * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
33
+ * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
34
+ * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
35
+ * month - Show only specific Month. Type `'current'` for displaying current month only or `'next'` for next month `[ecs-list-events cat='festival' month='2015-06']`
36
+ * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
37
+ * key - Hide the event when the start date/time has passed `[ecs-list-events cat='festival' key='start date']`
38
+ * orderby - Order by end date `[ecs-list-events orderby='enddate']`
39
+
40
+ <blockquote>
41
+ <h4>Additional options and benefits in the pro version</h4>
42
+ <ul>
43
+ <li>design - Shows <a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-design&utm_content=description#designs" target="_blank">improved design by default</a>, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show events horizontally in columns, or 'grouped' to group events by day</li>
44
+ <li>days - Specify how many days in the future, for example [ecs-list-events days="1"] for one day or [ecs-list-events days="7"] for one week</li>
45
+ <li>date - Show only events for a specific day [ecs-list-events date='2017-04-16']</li>
46
+ <li>tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.</li>
47
+ <li>city, state, country - Display events by location.</li>
48
+ <li>featured only - Show only events marked as "featured"</li>
49
+ <li>id - Show a single event, useful for displaying details of the event on a blog post or page</li>
50
+ <li>description - Use the full description instead of the excerpt of an event in the listing</li>
51
+ <li>raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description</li>
52
+ <li>raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt</li>
53
+ <li>year - Show only events for a specific year</li>
54
+ <li>date range - Show only events between certain days</li>
55
+ <li>timeonly - To show just the start time of the event. [ecs-list-events timeonly='true']</li>
56
+ <li>offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns</li>
57
+ <li>custom design - Create one or more of your own templates for use with the shortcode</li>
58
+ <li>hiderecurring - To only show the first instance of a recurring event, set to 'true'</li>
59
+ </ul>
60
+ <p><a href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme&utm_content=description">View more Pro features</a></p>
61
+ </blockquote>
62
+
63
+ This plugin is not developed by or affiliated with The Events Calendar or Modern Tribe in any way.
64
+
65
+ == Installation ==
66
+
67
+ 1. Install The Events Calendar Shortcode Plugin from the WordPress.org repository or by uploading the-events-calendar-shortcode folder to the /wp-content/plugins directory. You must also install The Event Calendar Plugin by Modern Tribe and add your events to the calendar.
68
+
69
+ 2. Activate the plugin through the Plugins menu in WordPress
70
+
71
+ 3. If you don't already have The Events Calendar (the calendar you add your events to) you will be prompted to install it
72
+
73
+ You can then add the `[ecs-list-events]` shortcode to the page or post you want to list events on. [Full list of options available in the documentation](https://eventcalendarnewsletter.com/events-calendar-shortcode-pro-options/?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-install-docs&utm_content=description).
74
+
75
+
76
+ == Frequently Asked Questions ==
77
+
78
+ = What are the shortcode options? =
79
+
80
+ * Basic shortcode: `[ecs-list-events]`
81
+ * cat - Show events from an event category `[ecs-list-events cat='festival']` or specify multiple categories `[ecs-list-events cat='festival, workshops']`
82
+ * limit - Total number of events to show. Default is 5. `[ecs-list-events limit='3']`
83
+ * order - Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date. `[ecs-list-events order='DESC']`
84
+ * date - To show or hide date. Value can be 'true' or 'false'. Default is true. `[ecs-list-events eventdetails='false']`
85
+ * venue - To show or hide the venue. Value can be 'true' or 'false'. Default is false. `[ecs-list-events venue='true']`
86
+ * excerpt - To show or hide the excerpt and set excerpt length. Default is false. `[ecs-list-events excerpt='true']` //displays excerpt with length 100
87
+ excerpt='300' //displays excerpt with length 300
88
+ * thumb - To show or hide thumbnail image. Default is false. `[ecs-list-events thumb='true']` //displays post thumbnail in default thumbnail dimension from media settings.
89
+ * thumbsize - Specify the size of the thumbnail. `[ecs-list-events thumb='true' thumbsize='large']`
90
+ * thumbwidth / thumbheight - Customize the thumbnail size in pixels `[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']`
91
+ * message - Message to show when there are no events. Defaults to 'There are no upcoming events at this time.'
92
+ * viewall - Determines whether to show 'View all events' or not. Values can be 'true' or 'false'. Default to 'true' `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']`
93
+ * contentorder - Manage the order of content with commas. Default to `title, thumbnail, excerpt, date, venue`. `[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']`
94
+ * month - Show only specific month (in YYYY-MM format). Type `'current'` for displaying current month only or `'next'` for next month. `[ecs-list-events cat='festival' month='2015-06']`
95
+ * past - Show Outdated Events. `[ecs-list-events cat='festival' past='yes']`
96
+ * key - Hide events when the start date has passed `[ecs-list-events cat='festival' key='start date']`
97
+ * orderby - Change the ordering to the end date `[ecs-list-events orderby="enddate"]`
98
+
99
+ With [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options&utm_content=description) you also get the following options:
100
+
101
+ * design - Shows improved design by default. Set to 'standard' for the regular one, 'compact' for a more compact listing, 'calendar' for a monthly calendar view, 'columns' to show a horizontal/columns/photo view, or 'grouped' to group events by day
102
+ * days - Specify how many days in the future, for example `[ecs-list-events days="1"]` for one day or `[ecs-list-events days="7"]` for one week
103
+ * tag - Filter by one or more tags. Use commas when you want to filter by multiple tags.
104
+ * id - Show a single event, useful for displaying details of the event on a blog post or page
105
+ * location (city, state/province, country) - Display events by location. Use commas when you want to include events from multiple (ie. country='United States, Canada')
106
+ * description - Use the full description instead of the excerpt of an event in the listing
107
+ * raw_description - Avoid filtering any HTML (spacing, links, bullet points, etc) in the description
108
+ * raw_excerpt - Avoid filtering any HTML (spacing, links, etc) in the excerpt
109
+ * featured only - Show only events marked as "featured"
110
+ * date - Show only events for a specific day `[ecs-list-events date='2017-04-16']`
111
+ * year - Show only events for a specific year `[ecs-list-events year='2017']`
112
+ * date range - Show only events between certain days `[ecs-list-events fromdate='2017-05-31' todate='2017-06-15']`
113
+ * timeonly - To show just the start time of the event. `[ecs-list-events timeonly='true']`
114
+ * offset - Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page (with ads in between) or splitting into columns
115
+ * custom design - Create one or more of your own templates for use with the shortcode
116
+ * hiderecurring - To only show the first instance of a recurring event, set to 'true'
117
+
118
+ [Get The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-options-bottom&utm_content=description)
119
+
120
+ = How do I use this shortcode in a widget? =
121
+
122
+ You can put the shortcode in a text widget, though not all themes support use of a shortcode in a widget.
123
+
124
+ If a regular text widget doesn't work, put the shortcode in a <a href="https://wordpress.org/plugins/black-studio-tinymce-widget/">Visual Editor Widget</a>.
125
+
126
+ = What are the classes for styling the list of events? =
127
+
128
+ By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling with a bit of CSS.
129
+
130
+ * ul class="ecs-event-list"
131
+ * li class="ecs-event" and "ecs-featured-event" (if featured)
132
+ * event title link is H4 class="entry-title summary"
133
+ * date class is time
134
+ * venue class is venue
135
+ * span .ecs-all-events
136
+ * p .ecs-excerpt
137
+
138
+ Want a better looking design without knowing any CSS? Check out [The Events Calendar Shortcode PRO](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-design&utm_content=description)
139
+
140
+ = How do I include a list of events in a page template? =
141
+
142
+ `include echo do_shortcode("[ecs-list-events]");`
143
+
144
+ Put this in the template where you want the events list to display.
145
+
146
+ = How do I include a monthly calendar view instead of a list? =
147
+
148
+ The [pro version of the plugin](https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=wordpress.org&utm_medium=link&utm_campaign=tecs-readme-faq-calendar&utm_content=description) has the option to put `design="calendar"` in the shortcode to show a calendar view of the events you want.
149
+
150
+ == Screenshots ==
151
+
152
+ 1. After adding the plugin, add the shortcode where you want the list of events to appear in the page
153
+ 2. Events will appear in a list
154
+ 3. Many settings you can use in the shortcode to change what details appear in the events listing
155
+
156
+ == Upgrade Notice ==
157
+
158
+ = 1.9 =
159
+ * Adds check for minimum WordPress and PHP version
160
+ * Adds a link to a short tutorial video
161
+ * Changes first example shortcode so it's easier to copy/paste
162
+
163
+ = 1.8 =
164
+ * Adds new orderby='title' option
165
+ * Fixes resetting the WordPress global query instead of just the post data
166
+
167
+ = 1.7.3 =
168
+ * Hide the "at" when using venue='true' and an event has no venue
169
+ * Adds additional WordPress filters to hide certain events
170
+
171
+ = 1.7.2 =
172
+ * Adds the ability to use schema='false' in the shortcode to hide the schema output
173
+
174
+ = 1.7.1 =
175
+ * Fix for month option where there's an all-day event the first day of the next month
176
+ * Fix for "There are no events" string not being translated automatically into other languages
177
+
178
+ = 1.7 =
179
+ * Adds structured data to the shortcode output (great for SEO and people finding your events)
180
+
181
+ = 1.6.1 =
182
+ * Added ecs-featured-event class if event is featured
183
+ * Internal changes to filtering by one or more categories
184
+
185
+ = 1.6 =
186
+ * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
187
+
188
+ = 1.5.3 =
189
+ * Fixes translation of the "View all events" link into other languages
190
+ * Adds orderby parameter to order by start date, but still show events until the end date has passed
191
+
192
+ = 1.5.2 =
193
+ * Adds 'next' option for showing the next month of events
194
+
195
+ = 1.5.1 =
196
+ * Adds thumbsize option (ie. medium, large, thumbnail, full)
197
+
198
+ = 1.5 =
199
+ * Adds ability to translate the plugin into local languages
200
+ * Additional description of options
201
+
202
+ = 1.4.2 =
203
+ * Additional filter for changing the link for an event
204
+ * Adds category CSS classes for each event, so you can format each category differently
205
+
206
+ = 1.4.1 =
207
+ * Additional filters for formatting a single event
208
+
209
+ = 1.4 =
210
+ * Checks for whether The Events Calendar is installed
211
+ * Additional filters
212
+ * Improved design of shortcode help page
213
+
214
+ = 1.3 =
215
+ * Fixes issue with "viewall" showing the events twice
216
+ * Fixes time zone issue by using current_time() instead of date()
217
+ * Hides events that are marked 'hide from listing'
218
+ * Switches to tribe_get_events() to get the events
219
+ * Removes the ... from the end of the excerpt if less than the excerpt length
220
+ * Adds date_thumb option
221
+ * Adds additional filters
222
+
223
+ = 1.2 =
224
+ * Updates author/description (Event Calendar Newsletter / Brian Hogg Consulting)
225
+
226
+ = 1.0.11 =
227
+ Add Link to Thumbnail
228
+ merge pull request from d4mation -Replaced extracted variables with $atts as using extract was deprecated
229
+ =1.0.10 =
230
+ Minor Error Change - fix name and slug
231
+ = 1.0.9 =
232
+ Minor Error Change - Multiple Categories
233
+ = 1.0.8 =
234
+ Add options : multi-categories - Thanks to sujin2f
235
+ = 1.0.7 =
236
+ Add options : contentorder, month, past, key - Thanks to sujin2f
237
+ = 1.0.6 =
238
+ Fix missing ul
239
+ = 1.0.5 =
240
+ * Add excerpt and thumbnail - Thanks to ankitpokhrel
241
+ = 1.0.2 =
242
+ * Add venue to shortcode - Thanks to ankitpokhrel
243
+ = 1.0.1 =
244
+ * Fix Firefox browser compatibility issue
245
+ = 1 =
246
+ * Initial Release
247
+
248
+ == Changelog ==
249
+
250
+ = 1.9 =
251
+ * Adds check for minimum WordPress and PHP version
252
+ * Adds a link to a short tutorial video
253
+ * Changes first example shortcode so it's easier to copy/paste
254
+
255
+ = 1.8 =
256
+ * Adds new orderby='title' option
257
+ * Fixes resetting the WordPress global query instead of just the post data
258
+
259
+ = 1.7.3 =
260
+ * Hide the "at" when using venue='true' and an event has no venue
261
+ * Adds additional WordPress filters to hide certain events
262
+
263
+ = 1.7.2 =
264
+ * Adds the ability to use schema='false' in the shortcode to hide the schema output
265
+
266
+ = 1.7.1 =
267
+ * Fix for month option where there's an all-day event the first day of the next month
268
+ * Fix for "There are no events" string not being translated automatically into other languages
269
+
270
+ = 1.7 =
271
+ * Adds structured data to the shortcode output (great for SEO and people finding your events)
272
+
273
+ = 1.6.1 =
274
+ * Added ecs-featured-event class if event is featured
275
+ * Internal changes to filtering by one or more categories
276
+
277
+ = 1.6 =
278
+ * Changes default ordering by the start date, use orderby="enddate" for previous default ordering
279
+
280
+ = 1.5.3 =
281
+ * Fixes translation of the "View all events" link into other languages
282
+ * Adds orderby parameter to order by start date, but still show events until the end date has passed
283
+
284
+ = 1.5.2 =
285
+ * Adds 'next' option for showing the next month of events
286
+
287
+ = 1.5.1 =
288
+ * Adds thumbsize option (ie. medium, large, thumbnail, full)
289
+
290
+ = 1.5 =
291
+ * Adds ability to translate the plugin into local languages
292
+ * Additional description of options
293
+
294
+ = 1.4.2 =
295
+ * Additional filter for changing the link for an event
296
+ * Adds category CSS classes for each event, so you can format each category differently
297
+
298
+ = 1.4.1 =
299
+ * Additional filters for formatting a single event
300
+
301
+ = 1.4 =
302
+ * Checks for whether The Events Calendar is installed
303
+ * Additional filters
304
+ * Improved design of shortcode help page
305
+
306
+ = 1.3 =
307
+ * Fixes issue with "viewall" showing the events twice
308
+ * Fixes time zone issue by using current_time() instead of date()
309
+ * Hides events that are marked 'hide from listing'
310
+ * Switches to tribe_get_events() to get the events
311
+ * Removes the ... from the end of the excerpt if less than the excerpt length
312
+ * Adds date_thumb option
313
+ * Adds additional filters
314
+
315
+ = 1.2 =
316
+ * Updates author/description (Event Calendar Newsletter / Brian Hogg Consulting)
317
+
318
+ = 1.0.11 =
319
+ Add Link to Thumbnail
320
+ merge pull request from d4mation -Replaced extracted variables with $atts as using extract was deprecated
321
+ =1.0.10 =
322
+ Minor Error Change - fix name and slug
323
+ = 1.0.9 =
324
+ Minor Error Change - Multiple Categories
325
+ = 1.0.8 =
326
+ Add options : multi-categories - Thanks to sujin2f
327
+ = 1.0.7 =
328
+ Add options : contentorder, month, past, key - Thanks to sujin2f
329
+ = 1.0.6 =
330
+ Fix missing ul
331
+ = 1.0.5 =
332
+ * Add excerpt and thumbnail - Thanks to ankitpokhrel
333
+ = 1.0.2 =
334
+ * Add venue to shortcode - Thanks to ankitpokhrel
335
+ = 1.0.1 =
336
+ * Fix Firefox browser compatibility issue
337
+ = 1 =
338
+ * Initial Release
static/ecs-admin.css CHANGED
@@ -1,7 +1,7 @@
1
- td.styling { border-left: 1px solid #000; padding-left: 10px; }
2
- td blockquote { font-family: monospace; }
3
- #ecs-pro-description { padding: 10px; border: 2px solid #f77530; background: white; }
4
- #ecs-pro-description h3.additional-options { padding-top: 30px; }
5
- #ecs-pro-description .ecs-button { text-decoration: none; padding: 6px 12px; background-color: #f77530; color: white; display: inline-block; text-align: center; }
6
- #ecs-pro-designs { text-align:center; }
7
- #ecs-pro-designs a { padding-bottom: 20px; }
1
+ td.styling { border-left: 1px solid #000; padding-left: 10px; }
2
+ td blockquote, p.shortcode { font-family: monospace; }
3
+ #ecs-pro-description { padding: 10px; border: 2px solid #f77530; background: white; }
4
+ #ecs-pro-description h3.additional-options { padding-top: 30px; }
5
+ #ecs-pro-description .ecs-button { text-decoration: none; padding: 6px 12px; background-color: #f77530; color: white; display: inline-block; text-align: center; }
6
+ #ecs-pro-designs { text-align:center; }
7
+ #ecs-pro-designs a { padding-bottom: 20px; }
templates/admin-page.php CHANGED
@@ -1,145 +1,147 @@
1
- <div class="wrap">
2
- <h2><?php _e( 'The Events Calendar Shortcode' ); ?></h2>
3
-
4
- <p><?php echo sprintf( esc_html__( 'The shortcode displays lists of your events. For example the shortcode to show next 8 events in the category "%s" in ASC order with date showing:', 'the-events-calendar-shortcode' ), 'festival' ); ?></p>
5
-
6
- <pre>[ecs-list-events cat='festival' limit='8']</pre>
7
-
8
- <table>
9
- <tbody>
10
- <tr valign="top">
11
- <td valign="top">
12
-
13
- <div>
14
- <h2><?php echo esc_html( __( 'Basic shortcode', 'the-events-calendar-shortcode' ) ); ?></h2>
15
- <blockquote>[ecs-list-events]</blockquote>
16
-
17
- <h2><?php echo esc_html( __( 'Shortcode Options', 'the-events-calendar-shortcode' ) ); ?></h2>
18
- <?php do_action( 'ecs_admin_page_options_before' ); ?>
19
-
20
- <h3>cat</h3>
21
- <p><?php echo esc_html( __( 'Represents single event category. Use commas when you want multiple categories', 'the-events-calendar-shortcode' ) ); ?>
22
- <blockquote>[ecs-list-events cat='festival']</blockquote>
23
- <blockquote>[ecs-list-events cat='festival, workshops']</blockquote>
24
-
25
- <?php do_action( 'ecs_admin_page_options_after_cat' ); ?>
26
-
27
- <h3>limit</h3>
28
- <p><?php echo esc_html( __( 'Total number of events to show. Default is 5.', 'the-events-calendar-shortcode' ) ); ?></p>
29
- <blockquote>[ecs-list-events limit='3']</blockquote>
30
- <h3>order</h3>
31
- <p><?php echo esc_html( __( "Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date.", 'the-events-calendar-shortcode' ) ); ?></p>
32
- <blockquote>[ecs-list-events order='DESC']</blockquote>
33
- <h3>date</h3>
34
- <p><?php echo esc_html( __( "To show or hide date. Value can be 'true' or 'false'. Default is true.", 'the-events-calendar-shortcode' ) ); ?></p>
35
- <blockquote>[ecs-list-events eventdetails='false']</blockquote>
36
- <h3>venue</h3>
37
- <p><?php echo esc_html( __( "To show or hide the venue. Value can be 'true' or 'false'. Default is false.", 'the-events-calendar-shortcode' ) ); ?></p>
38
- <blockquote>[ecs-list-events venue='true']</blockquote>
39
- <h3>excerpt</h3>
40
- <p><?php echo esc_html( __( 'To show or hide the excerpt and set excerpt length. Default is false.', 'the-events-calendar-shortcode' ) ); ?><p>
41
- <blockquote>[ecs-list-events excerpt='true']</blockquote>
42
- <blockquote>[ecs-list-events excerpt='300']</blockquote>
43
- <h3>thumb</h3>
44
- <p><?php echo esc_html( __( 'To show or hide thumbnail/featured image. Default is false.', 'the-events-calendar-shortcode' ) ); ?></p>
45
- <blockquote>[ecs-list-events thumb='true']</blockquote>
46
- <p><?php echo sprintf( esc_html( __( 'You can use 2 other attributes: %s and %s to customize the thumbnail size', 'the-events-calendar-shortcode' ) ), 'thumbwidth', 'thumbheight' ); ?></p>
47
- <blockquote>[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']</blockquote>
48
- <p><?php echo sprintf( esc_html( __( 'or use %s to specify the pre-set size to use, for example:', 'the-events-calendar-shortcode' ) ), 'thumbsize' ); ?></p>
49
- <blockquote>[ecs-list-events thumb='true' thumbsize='large']</blockquote>
50
-
51
- <h3>message</h3>
52
- <p><?php echo esc_html( sprintf( __( "Message to show when there are no events. Defaults to '%s'", 'the-events-calendar-shortcode' ), translate( 'There are no upcoming events at this time.', 'tribe-events-calendar' ) ) ); ?></p>
53
- <h3>viewall</h3>
54
- <?php if ( function_exists( 'tribe_get_event_label_plural' ) ): ?>
55
- <p><?php echo esc_html( sprintf( __( "Determines whether to show '%s' or not. Values can be 'true' or 'false'. Default to 'true'", 'the-events-calendar-shortcode' ), sprintf( __( 'View All %s', 'the-events-calendar' ), tribe_get_event_label_plural() ) ) ); ?></p>
56
- <?php endif; ?>
57
- <blockquote>[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']</blockquote>
58
- <h3>contentorder</h3>
59
- <p><?php echo esc_html( sprintf( __( 'Manage the order of content with commas. Defaults to %s', 'the-events-calendar-shortcode' ), 'title, thumbnail, excerpt, date, venue' ) ); ?> </p>
60
- <blockquote>[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']</blockquote>
61
- <h3>month</h3>
62
- <p><?php echo esc_html( sprintf( __( "Show only specific Month. Type '%s' for displaying current month only or '%s' for next month, ie:", 'the-events-calendar-shortcode' ), 'current', 'next' ) ); ?></p>
63
- <blockquote>[ecs-list-events cat='festival' month='2015-06']</blockquote>
64
- <h3>past</h3>
65
- <p><?php echo esc_html( __( 'Show outdated events (ie. events that have already happened)', 'the-events-calendar-shortcode' ) ); ?></p>
66
- <blockquote>[ecs-list-events cat='festival' past='yes']</blockquote>
67
- <h3>key</h3>
68
- <p><?php echo esc_html( __( 'Use to hide events when the start date has passed, rather than the end date. Will also change the order of events by start date instead of end date.', 'the-events-calendar-shortcode' ) ); ?></p>
69
- <blockquote>[ecs-list-events cat='festival' key='start date']</blockquote>
70
- <h3>orderby</h3>
71
- <p><?php echo esc_html( __( 'Used to order by the end date instead of the start date.', 'the-events-calendar-shortcode' ) ); ?></p>
72
- <blockquote>[ecs-list-events orderby='enddate']</blockquote>
73
- <p><?php echo esc_html( __( 'You can also use this to order by title if you wish:', 'the-events-calendar-shortcode' ) ); ?></p>
74
- <blockquote>[ecs-list-events orderby='title']</blockquote>
75
- <?php do_action( 'ecs_admin_page_options_after' ); ?>
76
-
77
- </div>
78
-
79
- </td>
80
- <td valign="top" class="styling">
81
- <h3>Styling/Design</h3>
82
-
83
- <?php do_action( 'ecs_admin_page_styling_before' ); ?>
84
-
85
- <?php if ( apply_filters( 'ecs_show_upgrades', true ) ): ?>
86
-
87
- <p><?php echo esc_html( __( 'By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling and you can add your own CSS:', 'the-events-calendar-shortcode' ) ) ?></p>
88
-
89
- <ul>
90
- <li>ul class="ecs-event-list"</li>
91
- <li>li class="ecs-event" &amp; "ecs-featured-event" <?php echo esc_html( __( '(if featured)', 'the-events-calendar-shortcode' ) ) ?></li>
92
- <li><?php echo esc_html( sprintf( __( 'event title link is %s', 'the-events-calendar-shortcode' ), 'H4 class="entry-title summary"' ) ); ?> </li>
93
- <li><?php echo esc_html( sprintf( __( 'date class is %s', 'the-events-calendar-shortcode' ), 'time' ) ); ?></li>
94
- <li><?php echo esc_html( sprintf( __( 'venue class is %s', 'the-events-calendar-shortcode' ), 'venue' ) ); ?></li>
95
- <li>span .ecs-all-events</li>
96
- <li>p .ecs-excerpt</li>
97
- </ul>
98
-
99
- <div id="ecs-pro-description">
100
-
101
- <h3><?php echo esc_html__( 'Want a better looking design without adding any CSS?', 'the-events-calendar-shortcode' ) ?></h3>
102
- <p><?php echo sprintf( esc_html__( 'Check out %sThe Events Calendar Shortcode PRO%s. Some examples of the designs:', 'the-events-calendar-shortcode' ), '<a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design&utm_content=description">', '</a>' ); ?></p>
103
- <div id="ecs-pro-designs">
104
- <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-1&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/shortcode-default-design-2.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version default design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
105
- <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-2&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/event-calendar-shortcode-compact-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version compact design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
106
- <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-calendar&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-calendar-demo.gif', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version calendar design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
107
- <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-columns&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-columns-photo-horizontal-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version horizontal/columns/photos design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
108
- <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-grouped&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-grouped-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version grouped design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
109
- </div>
110
-
111
- <h3 class="additional-options"><?php echo esc_html__( "In addition to designs, you'll get more options including:", 'the-events-calendar-shortcode' ); ?></h3>
112
- <h4><?php echo esc_html__( 'Number of days', 'the-events-calendar-shortcode' ) ?></h4>
113
- <p><?php echo esc_html__( 'Choose how many days to show events from, ie. 1 day or a week', 'the-events-calendar-shortcode' ) ?></p>
114
- <h4><?php echo esc_html__( 'Tag', 'the-events-calendar-shortcode' ) ?></h4>
115
- <p><?php echo esc_html__( 'Filter events listed by one or more tags', 'the-events-calendar-shortcode' ) ?></p>
116
- <h4><?php echo esc_html__( 'Location', 'the-events-calendar-shortcode' ) ?></h4>
117
- <p><?php echo esc_html__( 'Display events by city, state/province, or country', 'the-events-calendar-shortcode' ) ?></p>
118
- <h4><?php echo esc_html__( 'Single Event', 'the-events-calendar-shortcode' ) ?></h4>
119
- <p><?php echo esc_html__( 'List the details of a single event by ID, for example on a blog post', 'the-events-calendar-shortcode' ) ?></p>
120
- <h4><?php echo esc_html__( 'Featured', 'the-events-calendar-shortcode' ) ?></h4>
121
- <p><?php echo esc_html__( 'Show only events marked as "featured"', 'the-events-calendar-shortcode' ) ?></p>
122
- <h4><?php echo esc_html__( 'Button', 'the-events-calendar-shortcode' ) ?></h4>
123
- <p><?php echo esc_html__( 'Add an easy to see button link to your event, and customize the colors/text', 'the-events-calendar-shortcode' ) ?></p>
124
- <h4><?php echo esc_html__( 'Date', 'the-events-calendar-shortcode' ) ?></h4>
125
- <p><?php echo esc_html__( 'Show only events for a specific day (ie. 2017-04-16), great for conferences', 'the-events-calendar-shortcode' ) ?></p>
126
- <h4><?php echo esc_html__( 'Year', 'the-events-calendar-shortcode' ) ?></h4>
127
- <p><?php echo esc_html__( 'Show only events for a specific year', 'the-events-calendar-shortcode' ) ?></p>
128
- <h4><?php echo esc_html__( 'Offset', 'the-events-calendar-shortcode' ) ?></h4>
129
- <p><?php echo esc_html__( 'Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page or splitting into columns.', 'the-events-calendar-shortcode' ) ?></p>
130
- <h4><?php echo esc_html__( 'Full Description', 'the-events-calendar-shortcode' ) ?></h4>
131
- <p><?php echo esc_html__( 'Use the full description instead of the excerpt (short description) of an event in the listing', 'the-events-calendar-shortcode' ) ?></p>
132
- <h4><?php echo esc_html__( 'Future Only', 'the-events-calendar-shortcode' ) ?></h4>
133
- <p><?php echo esc_html__( 'Only show events in the future even when using the month or year option.', 'the-events-calendar-shortcode' ) ?></p>
134
- <h4><?php echo esc_html__( 'Custom Design', 'the-events-calendar-shortcode' ) ?></h4>
135
- <p><?php echo esc_html__( 'Use the new default or compact designs, or create your own using one or more templates in your theme folder', 'the-events-calendar-shortcode' ) ?></p>
136
- <p><?php echo sprintf( esc_html__( '%sGet The Events Calendar Shortcode PRO%s', 'the-events-calendar-shortcode' ), '<a class="ecs-button" target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-after-options&utm_content=description">', '</a>' ); ?> or <a href="https://demo.eventcalendarnewsletter.com/the-events-calendar-shortcode/">see it in action</p>
137
- </div>
138
- <?php endif; ?>
139
- </td>
140
- </tr>
141
- </tbody>
142
- </table>
143
-
144
- <p><small><?php echo sprintf( esc_html__( 'This plugin is not developed by or affiliated with The Events Calendar or %s in any way.', 'the-events-calendar-shortcode' ), 'Modern Tribe' ); ?></small></p>
 
 
145
  </div>
1
+ <div class="wrap">
2
+ <h2><?php _e( 'The Events Calendar Shortcode' ); ?></h2>
3
+
4
+ <p><?php echo sprintf( esc_html__( 'The shortcode displays lists of your events. For example the shortcode to show next 8 events in the category "%s" in ASC order with date showing:', 'the-events-calendar-shortcode' ), 'festival' ); ?></p>
5
+
6
+ <p class="shortcode">[ecs-list-events cat='festival' limit='8']</p>
7
+
8
+ <p><a href="https://youtu.be/0okrUs-xOq4" target="_blank"><?php echo esc_html( __( 'Watch a Short Walk Through Video', 'the-events-calendar-shortcode' ) ) ?></a></p>
9
+
10
+ <table>
11
+ <tbody>
12
+ <tr valign="top">
13
+ <td valign="top">
14
+
15
+ <div>
16
+ <h2><?php echo esc_html( __( 'Basic shortcode', 'the-events-calendar-shortcode' ) ); ?></h2>
17
+ <blockquote>[ecs-list-events]</blockquote>
18
+
19
+ <h2><?php echo esc_html( __( 'Shortcode Options', 'the-events-calendar-shortcode' ) ); ?></h2>
20
+ <?php do_action( 'ecs_admin_page_options_before' ); ?>
21
+
22
+ <h3>cat</h3>
23
+ <p><?php echo esc_html( __( 'Represents single event category. Use commas when you want multiple categories', 'the-events-calendar-shortcode' ) ); ?>
24
+ <blockquote>[ecs-list-events cat='festival']</blockquote>
25
+ <blockquote>[ecs-list-events cat='festival, workshops']</blockquote>
26
+
27
+ <?php do_action( 'ecs_admin_page_options_after_cat' ); ?>
28
+
29
+ <h3>limit</h3>
30
+ <p><?php echo esc_html( __( 'Total number of events to show. Default is 5.', 'the-events-calendar-shortcode' ) ); ?></p>
31
+ <blockquote>[ecs-list-events limit='3']</blockquote>
32
+ <h3>order</h3>
33
+ <p><?php echo esc_html( __( "Order of the events to be shown. Value can be 'ASC' or 'DESC'. Default is 'ASC'. Order is based on event date.", 'the-events-calendar-shortcode' ) ); ?></p>
34
+ <blockquote>[ecs-list-events order='DESC']</blockquote>
35
+ <h3>date</h3>
36
+ <p><?php echo esc_html( __( "To show or hide date. Value can be 'true' or 'false'. Default is true.", 'the-events-calendar-shortcode' ) ); ?></p>
37
+ <blockquote>[ecs-list-events eventdetails='false']</blockquote>
38
+ <h3>venue</h3>
39
+ <p><?php echo esc_html( __( "To show or hide the venue. Value can be 'true' or 'false'. Default is false.", 'the-events-calendar-shortcode' ) ); ?></p>
40
+ <blockquote>[ecs-list-events venue='true']</blockquote>
41
+ <h3>excerpt</h3>
42
+ <p><?php echo esc_html( __( 'To show or hide the excerpt and set excerpt length. Default is false.', 'the-events-calendar-shortcode' ) ); ?><p>
43
+ <blockquote>[ecs-list-events excerpt='true']</blockquote>
44
+ <blockquote>[ecs-list-events excerpt='300']</blockquote>
45
+ <h3>thumb</h3>
46
+ <p><?php echo esc_html( __( 'To show or hide thumbnail/featured image. Default is false.', 'the-events-calendar-shortcode' ) ); ?></p>
47
+ <blockquote>[ecs-list-events thumb='true']</blockquote>
48
+ <p><?php echo sprintf( esc_html( __( 'You can use 2 other attributes: %s and %s to customize the thumbnail size', 'the-events-calendar-shortcode' ) ), 'thumbwidth', 'thumbheight' ); ?></p>
49
+ <blockquote>[ecs-list-events thumb='true' thumbwidth='150' thumbheight='150']</blockquote>
50
+ <p><?php echo sprintf( esc_html( __( 'or use %s to specify the pre-set size to use, for example:', 'the-events-calendar-shortcode' ) ), 'thumbsize' ); ?></p>
51
+ <blockquote>[ecs-list-events thumb='true' thumbsize='large']</blockquote>
52
+
53
+ <h3>message</h3>
54
+ <p><?php echo esc_html( sprintf( __( "Message to show when there are no events. Defaults to '%s'", 'the-events-calendar-shortcode' ), translate( 'There are no upcoming events at this time.', 'tribe-events-calendar' ) ) ); ?></p>
55
+ <h3>viewall</h3>
56
+ <?php if ( function_exists( 'tribe_get_event_label_plural' ) ): ?>
57
+ <p><?php echo esc_html( sprintf( __( "Determines whether to show '%s' or not. Values can be 'true' or 'false'. Default to 'true'", 'the-events-calendar-shortcode' ), sprintf( __( 'View All %s', 'the-events-calendar' ), tribe_get_event_label_plural() ) ) ); ?></p>
58
+ <?php endif; ?>
59
+ <blockquote>[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false']</blockquote>
60
+ <h3>contentorder</h3>
61
+ <p><?php echo esc_html( sprintf( __( 'Manage the order of content with commas. Defaults to %s', 'the-events-calendar-shortcode' ), 'title, thumbnail, excerpt, date, venue' ) ); ?> </p>
62
+ <blockquote>[ecs-list-events cat='festival' limit='3' order='DESC' viewall='false' contentorder='title, thumbnail, excerpt, date, venue']</blockquote>
63
+ <h3>month</h3>
64
+ <p><?php echo esc_html( sprintf( __( "Show only specific Month. Type '%s' for displaying current month only or '%s' for next month, ie:", 'the-events-calendar-shortcode' ), 'current', 'next' ) ); ?></p>
65
+ <blockquote>[ecs-list-events cat='festival' month='2015-06']</blockquote>
66
+ <h3>past</h3>
67
+ <p><?php echo esc_html( __( 'Show outdated events (ie. events that have already happened)', 'the-events-calendar-shortcode' ) ); ?></p>
68
+ <blockquote>[ecs-list-events cat='festival' past='yes']</blockquote>
69
+ <h3>key</h3>
70
+ <p><?php echo esc_html( __( 'Use to hide events when the start date has passed, rather than the end date. Will also change the order of events by start date instead of end date.', 'the-events-calendar-shortcode' ) ); ?></p>
71
+ <blockquote>[ecs-list-events cat='festival' key='start date']</blockquote>
72
+ <h3>orderby</h3>
73
+ <p><?php echo esc_html( __( 'Used to order by the end date instead of the start date.', 'the-events-calendar-shortcode' ) ); ?></p>
74
+ <blockquote>[ecs-list-events orderby='enddate']</blockquote>
75
+ <p><?php echo esc_html( __( 'You can also use this to order by title if you wish:', 'the-events-calendar-shortcode' ) ); ?></p>
76
+ <blockquote>[ecs-list-events orderby='title']</blockquote>
77
+ <?php do_action( 'ecs_admin_page_options_after' ); ?>
78
+
79
+ </div>
80
+
81
+ </td>
82
+ <td valign="top" class="styling">
83
+ <h3>Styling/Design</h3>
84
+
85
+ <?php do_action( 'ecs_admin_page_styling_before' ); ?>
86
+
87
+ <?php if ( apply_filters( 'ecs_show_upgrades', true ) ): ?>
88
+
89
+ <p><?php echo esc_html( __( 'By default the plugin does not include styling. Events are listed in ul li tags with appropriate classes for styling and you can add your own CSS:', 'the-events-calendar-shortcode' ) ) ?></p>
90
+
91
+ <ul>
92
+ <li>ul class="ecs-event-list"</li>
93
+ <li>li class="ecs-event" &amp; "ecs-featured-event" <?php echo esc_html( __( '(if featured)', 'the-events-calendar-shortcode' ) ) ?></li>
94
+ <li><?php echo esc_html( sprintf( __( 'event title link is %s', 'the-events-calendar-shortcode' ), 'H4 class="entry-title summary"' ) ); ?> </li>
95
+ <li><?php echo esc_html( sprintf( __( 'date class is %s', 'the-events-calendar-shortcode' ), 'time' ) ); ?></li>
96
+ <li><?php echo esc_html( sprintf( __( 'venue class is %s', 'the-events-calendar-shortcode' ), 'venue' ) ); ?></li>
97
+ <li>span .ecs-all-events</li>
98
+ <li>p .ecs-excerpt</li>
99
+ </ul>
100
+
101
+ <div id="ecs-pro-description">
102
+
103
+ <h3><?php echo esc_html__( 'Want a better looking design without adding any CSS?', 'the-events-calendar-shortcode' ) ?></h3>
104
+ <p><?php echo sprintf( esc_html__( 'Check out %sThe Events Calendar Shortcode PRO%s. Some examples of the designs:', 'the-events-calendar-shortcode' ), '<a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design&utm_content=description">', '</a>' ); ?></p>
105
+ <div id="ecs-pro-designs">
106
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-1&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/shortcode-default-design-2.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version default design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
107
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-2&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/event-calendar-shortcode-compact-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version compact design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
108
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-calendar&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-calendar-demo.gif', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version calendar design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
109
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-columns&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-columns-photo-horizontal-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version horizontal/columns/photos design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
110
+ <p><a target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-design-image-grouped&utm_content=description"><img alt="" style="width: 300px;" src="<?php echo plugins_url( '/static/the-events-calendar-shortcode-grouped-design.png', TECS_CORE_PLUGIN_FILE ) ?>"><br><?php echo esc_html( __( 'Pro version grouped design example', 'the-events-calendar-shortcode' ) ); ?></a></p>
111
+ </div>
112
+
113
+ <h3 class="additional-options"><?php echo esc_html__( "In addition to designs, you'll get more options including:", 'the-events-calendar-shortcode' ); ?></h3>
114
+ <h4><?php echo esc_html__( 'Number of days', 'the-events-calendar-shortcode' ) ?></h4>
115
+ <p><?php echo esc_html__( 'Choose how many days to show events from, ie. 1 day or a week', 'the-events-calendar-shortcode' ) ?></p>
116
+ <h4><?php echo esc_html__( 'Tag', 'the-events-calendar-shortcode' ) ?></h4>
117
+ <p><?php echo esc_html__( 'Filter events listed by one or more tags', 'the-events-calendar-shortcode' ) ?></p>
118
+ <h4><?php echo esc_html__( 'Location', 'the-events-calendar-shortcode' ) ?></h4>
119
+ <p><?php echo esc_html__( 'Display events by city, state/province, or country', 'the-events-calendar-shortcode' ) ?></p>
120
+ <h4><?php echo esc_html__( 'Single Event', 'the-events-calendar-shortcode' ) ?></h4>
121
+ <p><?php echo esc_html__( 'List the details of a single event by ID, for example on a blog post', 'the-events-calendar-shortcode' ) ?></p>
122
+ <h4><?php echo esc_html__( 'Featured', 'the-events-calendar-shortcode' ) ?></h4>
123
+ <p><?php echo esc_html__( 'Show only events marked as "featured"', 'the-events-calendar-shortcode' ) ?></p>
124
+ <h4><?php echo esc_html__( 'Button', 'the-events-calendar-shortcode' ) ?></h4>
125
+ <p><?php echo esc_html__( 'Add an easy to see button link to your event, and customize the colors/text', 'the-events-calendar-shortcode' ) ?></p>
126
+ <h4><?php echo esc_html__( 'Date', 'the-events-calendar-shortcode' ) ?></h4>
127
+ <p><?php echo esc_html__( 'Show only events for a specific day (ie. 2017-04-16), great for conferences', 'the-events-calendar-shortcode' ) ?></p>
128
+ <h4><?php echo esc_html__( 'Year', 'the-events-calendar-shortcode' ) ?></h4>
129
+ <p><?php echo esc_html__( 'Show only events for a specific year', 'the-events-calendar-shortcode' ) ?></p>
130
+ <h4><?php echo esc_html__( 'Offset', 'the-events-calendar-shortcode' ) ?></h4>
131
+ <p><?php echo esc_html__( 'Skip a certain number of events from the beginning, useful for using multiple shortcodes on the same page or splitting into columns.', 'the-events-calendar-shortcode' ) ?></p>
132
+ <h4><?php echo esc_html__( 'Full Description', 'the-events-calendar-shortcode' ) ?></h4>
133
+ <p><?php echo esc_html__( 'Use the full description instead of the excerpt (short description) of an event in the listing', 'the-events-calendar-shortcode' ) ?></p>
134
+ <h4><?php echo esc_html__( 'Future Only', 'the-events-calendar-shortcode' ) ?></h4>
135
+ <p><?php echo esc_html__( 'Only show events in the future even when using the month or year option.', 'the-events-calendar-shortcode' ) ?></p>
136
+ <h4><?php echo esc_html__( 'Custom Design', 'the-events-calendar-shortcode' ) ?></h4>
137
+ <p><?php echo esc_html__( 'Use the new default or compact designs, or create your own using one or more templates in your theme folder', 'the-events-calendar-shortcode' ) ?></p>
138
+ <p><?php echo sprintf( esc_html__( '%sGet The Events Calendar Shortcode PRO%s', 'the-events-calendar-shortcode' ), '<a class="ecs-button" target="_blank" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode?utm_source=plugin&utm_medium=link&utm_campaign=tecs-help-after-options&utm_content=description">', '</a>' ); ?> or <a href="https://demo.eventcalendarnewsletter.com/the-events-calendar-shortcode/">see it in action</p>
139
+ </div>
140
+ <?php endif; ?>
141
+ </td>
142
+ </tr>
143
+ </tbody>
144
+ </table>
145
+
146
+ <p><small><?php echo sprintf( esc_html__( 'This plugin is not developed by or affiliated with The Events Calendar or %s in any way.', 'the-events-calendar-shortcode' ), 'Modern Tribe' ); ?></small></p>
147
  </div>
the-events-calendar-shortcode.php CHANGED
@@ -1,432 +1,446 @@
1
- <?php
2
- /***
3
- Plugin Name: The Events Calendar Shortcode
4
- Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
- Description: An addon to add shortcode functionality for <a href="http://wordpress.org/plugins/the-events-calendar/">The Events Calendar Plugin by Modern Tribe</a>.
6
- Version: 1.8
7
- Author: Event Calendar Newsletter
8
- Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
- Contributors: brianhogg
10
- License: GPL2 or later
11
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
- Text Domain: the-events-calendar-shortcode
13
- */
14
-
15
- // Avoid direct calls to this file
16
- if ( !defined( 'ABSPATH' ) ) {
17
- header( 'Status: 403 Forbidden' );
18
- header( 'HTTP/1.1 403 Forbidden' );
19
- exit();
20
- }
21
-
22
- define( 'TECS_CORE_PLUGIN_FILE', __FILE__ );
23
-
24
- /**
25
- * Events calendar shortcode addon main class
26
- *
27
- * @package events-calendar-shortcode
28
- * @author Brian Hogg
29
- * @version 1.0.10
30
- */
31
-
32
- if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
33
-
34
- class Events_Calendar_Shortcode
35
- {
36
- /**
37
- * Current version of the plugin.
38
- *
39
- * @since 1.0.0
40
- */
41
- const VERSION = '1.8';
42
-
43
- private $admin_page = null;
44
-
45
- const MENU_SLUG = 'ecs-admin';
46
-
47
- /**
48
- * Constructor. Hooks all interactions to initialize the class.
49
- *
50
- * @since 1.0.0
51
- * @access public
52
- *
53
- * @see add_shortcode()
54
- */
55
- public function __construct() {
56
- add_action( 'plugins_loaded', array( $this, 'verify_tec_installed' ), 2 );
57
- add_action( 'admin_menu', array( $this, 'add_menu_page' ), 1000 );
58
- add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_action_links' ) );
59
- add_shortcode( 'ecs-list-events', array( $this, 'ecs_fetch_events' ) );
60
- add_filter( 'ecs_ending_output', array( $this, 'add_event_schema_json' ), 10, 3 );
61
- add_action( 'plugins_loaded', array( $this, 'load_languages' ) );
62
-
63
- } // END __construct()
64
-
65
- public function load_languages() {
66
- if ( function_exists( 'tecsp_load_textdomain' ) )
67
- return;
68
- load_plugin_textdomain( 'the-events-calendar-shortcode', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
69
- }
70
-
71
- public function verify_tec_installed() {
72
- if ( ! class_exists( 'Tribe__Events__Main' ) or ! defined( 'Tribe__Events__Main::VERSION' )) {
73
- add_action( 'admin_notices', array( $this, 'show_tec_not_installed_message' ) );
74
- }
75
- }
76
-
77
- public function show_tec_not_installed_message() {
78
- if ( current_user_can( 'activate_plugins' ) ) {
79
- $url = 'plugin-install.php?tab=plugin-information&plugin=the-events-calendar&TB_iframe=true';
80
- $title = __( 'The Events Calendar', 'tribe-events-ical-importer' );
81
- echo '<div class="error"><p>' . sprintf( esc_html( __( 'To begin using %s, please install the latest version of %s%s%s and add an event.', 'the-events-calendar-shortcode' ) ), 'The Events Calendar Shortcode', '<a href="' . esc_url( $url ) . '" class="thickbox" title="' . esc_attr( $title ) . '">', 'The Events Calendar', '</a>' ) . '</p></div>';
82
- }
83
- }
84
-
85
- public function add_menu_page() {
86
- if ( ! class_exists( 'Tribe__Settings' ) or ! method_exists( Tribe__Settings::instance(), 'should_setup_pages' ) or ! Tribe__Settings::instance()->should_setup_pages() ) {
87
- return;
88
- }
89
-
90
- $page_title = esc_html__( 'Shortcode', 'the-events-calendar-shortcode' );
91
- $menu_title = esc_html__( 'Shortcode', 'tribe-common' );
92
- $capability = apply_filters( 'ecs_admin_page_capability', 'install_plugins' );
93
-
94
- $where = Tribe__Settings::instance()->get_parent_slug();
95
-
96
- $this->admin_page = add_submenu_page( $where, $page_title, $menu_title, $capability, self::MENU_SLUG, array( $this, 'do_menu_page' ) );
97
-
98
- add_action( 'admin_print_styles-' . $this->admin_page, array( $this, 'enqueue' ) );
99
- add_action( 'admin_print_styles', array( $this, 'enqueue_submenu_style' ) );
100
- }
101
-
102
- public function enqueue() {
103
- wp_enqueue_style( 'ecs-admin-css', plugins_url( 'static/ecs-admin.css', __FILE__ ), array(), self::VERSION );
104
- wp_enqueue_script( 'ecs-admin-js', plugins_url( 'static/ecs-admin.js', __FILE__ ), array(), self::VERSION );
105
- }
106
-
107
- /**
108
- * Function to add a small CSS file to add some colour to the Shortcode submenu item
109
- */
110
- public function enqueue_submenu_style() {
111
- wp_enqueue_style( 'ecs-submenu-css', plugins_url( 'static/ecs-submenu.css', __FILE__ ), array(), self::VERSION );
112
- }
113
-
114
- public function do_menu_page() {
115
- include dirname( __FILE__ ) . '/templates/admin-page.php';
116
- }
117
-
118
- public function add_action_links( $links ) {
119
- $mylinks = array();
120
- if ( class_exists( 'Tribe__Settings' ) and method_exists( Tribe__Settings::instance(), 'should_setup_pages' ) and Tribe__Settings::instance()->should_setup_pages() )
121
- $mylinks[] = '<a href="' . admin_url( 'edit.php?post_type=tribe_events&page=ecs-admin' ) . '">' . esc_html__( 'Settings', 'the-events-calendar-shortcode' ) . '</a>';
122
- $mylinks[] = '<a target="_blank" style="color:#3db634; font-weight: bold;" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=plugin-list&utm_medium=upgrade-link&utm_campaign=plugin-list&utm_content=action-link">' . esc_html__( 'Upgrade', 'the-events-calendar-shortcode' ) . '</a>';
123
-
124
- return array_merge( $links, $mylinks );
125
- }
126
-
127
- /**
128
- * Fetch and return required events.
129
- * @param array $atts shortcode attributes
130
- * @return string shortcode output
131
- */
132
- public function ecs_fetch_events( $atts ) {
133
- /**
134
- * Check if events calendar plugin method exists
135
- */
136
- if ( !function_exists( 'tribe_get_events' ) ) {
137
- return '';
138
- }
139
-
140
- global $post;
141
- $output = '';
142
-
143
- $atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
144
- 'cat' => '',
145
- 'month' => '',
146
- 'limit' => 5,
147
- 'eventdetails' => 'true',
148
- 'time' => null,
149
- 'past' => null,
150
- 'venue' => 'false',
151
- 'author' => null,
152
- 'schema' => 'true',
153
- 'message' => 'There are no upcoming %s at this time.',
154
- 'key' => 'End Date',
155
- 'order' => 'ASC',
156
- 'orderby' => 'startdate',
157
- 'viewall' => 'false',
158
- 'excerpt' => 'false',
159
- 'thumb' => 'false',
160
- 'thumbsize' => '',
161
- 'thumbwidth' => '',
162
- 'thumbheight' => '',
163
- 'contentorder' => apply_filters( 'ecs_default_contentorder', 'title, thumbnail, excerpt, date, venue', $atts ),
164
- 'event_tax' => '',
165
- ), $atts ), $atts, 'ecs-list-events' );
166
-
167
- // Category
168
- if ( $atts['cat'] ) {
169
- if ( strpos( $atts['cat'], "," ) !== false ) {
170
- $atts['cats'] = explode( ",", $atts['cat'] );
171
- $atts['cats'] = array_map( 'trim', $atts['cats'] );
172
- } else {
173
- $atts['cats'] = array( trim( $atts['cat'] ) );
174
- }
175
-
176
- $atts['event_tax'] = array(
177
- 'relation' => 'OR',
178
- );
179
-
180
- foreach ( $atts['cats'] as $cat ) {
181
- $atts['event_tax'][] = array(
182
- 'taxonomy' => 'tribe_events_cat',
183
- 'field' => 'name',
184
- 'terms' => $cat,
185
- );
186
- $atts['event_tax'][] = array(
187
- 'taxonomy' => 'tribe_events_cat',
188
- 'field' => 'slug',
189
- 'terms' => $cat,
190
- );
191
- }
192
- }
193
-
194
- // Past Event
195
- $meta_date_compare = '>=';
196
- $meta_date_date = current_time( 'Y-m-d H:i:s' );
197
-
198
- if ( $atts['time'] == 'past' || !empty( $atts['past'] ) ) {
199
- $meta_date_compare = '<';
200
- }
201
-
202
- // Key, used in filtering events by date
203
- if ( str_replace( ' ', '', trim( strtolower( $atts['key'] ) ) ) == 'startdate' ) {
204
- $atts['key'] = '_EventStartDate';
205
- } else {
206
- $atts['key'] = '_EventEndDate';
207
- }
208
-
209
- // Orderby
210
- if ( str_replace( ' ', '', trim( strtolower( $atts['orderby'] ) ) ) == 'enddate' ) {
211
- $atts['orderby'] = '_EventEndDate';
212
- } elseif ( trim( strtolower( $atts['orderby'] ) ) == 'title' ) {
213
- $atts['orderby'] = 'title';
214
- } else {
215
- $atts['orderby'] = '_EventStartDate';
216
- }
217
-
218
- // Date
219
- $atts['meta_date'] = array(
220
- array(
221
- 'key' => $atts['key'],
222
- 'value' => $meta_date_date,
223
- 'compare' => $meta_date_compare,
224
- 'type' => 'DATETIME'
225
- )
226
- );
227
-
228
- // Specific Month
229
- if ( 'current' == $atts['month'] ) {
230
- $atts['month'] = current_time( 'Y-m' );
231
- }
232
- if ( 'next' == $atts['month'] ) {
233
- $atts['month'] = date( 'Y-m', strtotime( '+1 months', current_time( 'timestamp' ) ) );
234
- }
235
- if ($atts['month']) {
236
- $month_array = explode("-", $atts['month']);
237
-
238
- $month_yearstr = $month_array[0];
239
- $month_monthstr = $month_array[1];
240
- $month_startdate = date( "Y-m-d", strtotime( $month_yearstr . "-" . $month_monthstr . "-01" ) );
241
- $month_enddate = date( "Y-m-01", strtotime( "+1 month", strtotime( $month_startdate ) ) );
242
-
243
- $atts['meta_date'] = array(
244
- 'relation' => 'AND',
245
- array(
246
- 'key' => $atts['key'],
247
- 'value' => $month_startdate,
248
- 'compare' => '>=',
249
- 'type' => 'DATETIME'
250
- ),
251
- array(
252
- 'key' => $atts['key'],
253
- 'value' => $month_enddate,
254
- 'compare' => '<',
255
- 'type' => 'DATETIME'
256
- )
257
- );
258
- }
259
-
260
- $posts = tribe_get_events( apply_filters( 'ecs_get_events_args', array(
261
- 'post_status' => 'publish',
262
- 'hide_upcoming' => true,
263
- 'posts_per_page' => $atts['limit'],
264
- 'tax_query'=> $atts['event_tax'],
265
- 'meta_key' => ( ( trim( $atts['orderby'] ) and 'title' != $atts['orderby'] ) ? $atts['orderby'] : $atts['key'] ),
266
- 'orderby' => ( $atts['orderby'] == 'title' ? 'title' : 'meta_value' ),
267
- 'author' => $atts['author'],
268
- 'order' => $atts['order'],
269
- 'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
270
- ), $atts, $meta_date_date, $meta_date_compare ) );
271
- $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
272
-
273
- if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
274
- $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
275
- $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts );
276
- $atts['contentorder'] = explode( ',', $atts['contentorder'] );
277
-
278
- foreach( (array) $posts as $post_index => $post ) {
279
- setup_postdata( $post );
280
- $event_output = '';
281
- if ( apply_filters( 'ecs_skip_event', false, $atts, $post ) )
282
- continue;
283
- $category_slugs = array();
284
- $category_list = get_the_terms( $post, 'tribe_events_cat' );
285
- $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
286
- if ( is_array( $category_list ) ) {
287
- foreach ( (array) $category_list as $category ) {
288
- $category_slugs[] = ' ' . $category->slug . '_ecs_category';
289
- }
290
- }
291
- $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . $featured_class . apply_filters( 'ecs_event_classes', '', $atts, $post ) . '">', $atts, $post );
292
-
293
- // Put Values into $event_output
294
- foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
295
- switch ( trim( $contentorder ) ) {
296
- case 'title':
297
- $event_output .= apply_filters( 'ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post ) .
298
- apply_filters( 'ecs_event_list_title_link_start', '<a href="' . tribe_get_event_link() . '" rel="bookmark">', $atts, $post ) . apply_filters( 'ecs_event_list_title', get_the_title(), $atts, $post ) . apply_filters( 'ecs_event_list_title_link_end', '</a>', $atts, $post ) .
299
- apply_filters( 'ecs_event_title_tag_end', '</h4>', $atts, $post );
300
- break;
301
-
302
- case 'thumbnail':
303
- if ( self::isValid( $atts['thumb'] ) ) {
304
- $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : '';
305
- $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : '';
306
- if( !empty( $thumbWidth ) && !empty( $thumbHeight ) ) {
307
- $event_output .= apply_filters( 'ecs_event_thumbnail', get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', array( $thumbWidth, $thumbHeight ), $atts, $post ) ), $atts, $post );
308
- } else {
309
- if ( $thumb = get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', ( trim( $atts['thumbsize'] ) ? trim( $atts['thumbsize'] ) : 'medium' ), $atts, $post ) ) ) {
310
- $event_output .= apply_filters( 'ecs_event_thumbnail_link_start', '<a href="' . tribe_get_event_link() . '">', $atts, $post );
311
- $event_output .= apply_filters( 'ecs_event_thumbnail', $thumb, $atts, $post );
312
- $event_output .= apply_filters( 'ecs_event_thumbnail_link_end', '</a>', $atts, $post );
313
- }
314
- }
315
- }
316
- break;
317
-
318
- case 'excerpt':
319
- if ( self::isValid( $atts['excerpt'] ) ) {
320
- $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100;
321
- $event_output .= apply_filters( 'ecs_event_excerpt_tag_start', '<p class="ecs-excerpt">', $atts, $post ) .
322
- apply_filters( 'ecs_event_excerpt', self::get_excerpt( $excerptLength ), $atts, $post, $excerptLength ) .
323
- apply_filters( 'ecs_event_excerpt_tag_end', '</p>', $atts, $post );
324
- }
325
- break;
326
-
327
- case 'date':
328
- if ( self::isValid( $atts['eventdetails'] ) ) {
329
- $event_output .= apply_filters( 'ecs_event_date_tag_start', '<span class="duration time">', $atts, $post ) .
330
- apply_filters( 'ecs_event_list_details', tribe_events_event_schedule_details(), $atts, $post ) .
331
- apply_filters( 'ecs_event_date_tag_end', '</span>', $atts, $post );
332
- }
333
- break;
334
-
335
- case 'venue':
336
- if ( self::isValid( $atts['venue'] ) and function_exists( 'tribe_has_venue' ) and tribe_has_venue() ) {
337
- $event_output .= apply_filters( 'ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post ) .
338
- apply_filters( 'ecs_event_venue_at_tag_start', '<em> ', $atts, $post ) .
339
- apply_filters( 'ecs_event_venue_at_text', __( 'at', 'the-events-calendar-shortcode' ), $atts, $post ) .
340
- apply_filters( 'ecs_event_venue_at_tag_end', ' </em>', $atts, $post ) .
341
- apply_filters( 'ecs_event_list_venue', tribe_get_venue(), $atts, $post ) .
342
- apply_filters( 'ecs_event_venue_tag_end', '</span>', $atts, $post );
343
- }
344
- break;
345
- case 'date_thumb':
346
- if ( self::isValid( $atts['eventdetails'] ) ) {
347
- $event_output .= apply_filters( 'ecs_event_date_thumb', '<div class="date_thumb"><div class="month">' . tribe_get_start_date( null, false, 'M' ) . '</div><div class="day">' . tribe_get_start_date( null, false, 'j' ) . '</div></div>', $atts, $post );
348
- }
349
- break;
350
- default:
351
- $event_output .= apply_filters( 'ecs_event_list_output_custom_' . strtolower( trim( $contentorder ) ), '', $atts, $post );
352
- }
353
- }
354
- $event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
355
- $output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post, $post_index, $posts );
356
- }
357
- $output .= apply_filters( 'ecs_end_tag', '</ul>', $atts );
358
- $output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
359
-
360
- if( self::isValid( $atts['viewall'] ) ) {
361
- $output .= apply_filters( 'ecs_view_all_events_tag_start', '<span class="ecs-all-events">', $atts ) .
362
- '<a href="' . apply_filters( 'ecs_event_list_viewall_link', tribe_get_events_link(), $atts ) .'" rel="bookmark">' . apply_filters( 'ecs_view_all_events_text', sprintf( __( 'View All %s', 'the-events-calendar' ), tribe_get_event_label_plural() ), $atts ) . '</a>';
363
- $output .= apply_filters( 'ecs_view_all_events_tag_end', '</span>' );
364
- }
365
-
366
- } else { //No Events were Found
367
- $output .= apply_filters( 'ecs_no_events_found_message', sprintf( translate( $atts['message'], 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts );
368
- } // endif
369
-
370
- wp_reset_postdata();
371
-
372
- return $output;
373
- }
374
-
375
- public function add_event_schema_json( $output, $posts, $atts ) {
376
- if ( self::isValid( $atts['schema'] ) and $posts and class_exists( 'Tribe__Events__JSON_LD__Event' ) and ( ! defined( 'DOING_AJAX' ) or ! DOING_AJAX ) )
377
- $output .= Tribe__Events__JSON_LD__Event::instance()->get_markup( $posts );
378
- return $output;
379
- }
380
-
381
- /**
382
- * Checks if the plugin attribute is valid
383
- *
384
- * @since 1.0.5
385
- *
386
- * @param string $prop
387
- * @return boolean
388
- */
389
- public static function isValid( $prop )
390
- {
391
- return ( $prop !== 'false' );
392
- }
393
-
394
- /**
395
- * Fetch and trims the excerpt to specified length
396
- *
397
- * @param integer $limit Characters to show
398
- * @param string $source content or excerpt
399
- *
400
- * @return string
401
- */
402
- public static function get_excerpt( $limit, $source = null )
403
- {
404
- $excerpt = get_the_excerpt();
405
- if( $source == "content" ) {
406
- $excerpt = get_the_content();
407
- }
408
-
409
- $excerpt = preg_replace( " (\[.*?\])", '', $excerpt );
410
- $excerpt = strip_tags( strip_shortcodes($excerpt) );
411
- $excerpt = trim( preg_replace( '/\s+/', ' ', $excerpt ) );
412
- if ( strlen( $excerpt ) > $limit ) {
413
- $excerpt = substr( $excerpt, 0, $limit );
414
- $excerpt .= '...';
415
- }
416
-
417
- return $excerpt;
418
- }
419
- }
420
-
421
- }
422
-
423
- /**
424
- * Instantiate the main class
425
- *
426
- * @since 1.0.0
427
- * @access public
428
- *
429
- * @var object $events_calendar_shortcode holds the instantiated class {@uses Events_Calendar_Shortcode}
430
- */
431
- global $events_calendar_shortcode;
432
- $events_calendar_shortcode = new Events_Calendar_Shortcode();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***
3
+ Plugin Name: The Events Calendar Shortcode
4
+ Plugin URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode/
5
+ Description: An addon to add shortcode functionality for <a href="http://wordpress.org/plugins/the-events-calendar/">The Events Calendar Plugin by Modern Tribe</a>.
6
+ Version: 1.9
7
+ Author: Event Calendar Newsletter
8
+ Author URI: https://eventcalendarnewsletter.com/the-events-calendar-shortcode
9
+ Contributors: brianhogg
10
+ License: GPL2 or later
11
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
+ Text Domain: the-events-calendar-shortcode
13
+ */
14
+
15
+ // Avoid direct calls to this file
16
+ if ( !defined( 'ABSPATH' ) ) {
17
+ header( 'Status: 403 Forbidden' );
18
+ header( 'HTTP/1.1 403 Forbidden' );
19
+ exit();
20
+ }
21
+
22
+ define( 'TECS_CORE_PLUGIN_FILE', __FILE__ );
23
+
24
+ include_once dirname( TECS_CORE_PLUGIN_FILE ) . '/includes/wp-requirements.php';
25
+
26
+ // Check plugin requirements before loading plugin.
27
+ $this_plugin_checks = new TECS_WP_Requirements( 'The Events Calendar Shortcode', plugin_basename( TECS_CORE_PLUGIN_FILE ), array(
28
+ 'PHP' => '5.3.3',
29
+ 'WordPress' => '4.1',
30
+ 'Extensions' => array(
31
+ ),
32
+ ) );
33
+ if ( $this_plugin_checks->pass() === false ) {
34
+ $this_plugin_checks->halt();
35
+ return;
36
+ }
37
+
38
+ /**
39
+ * Events calendar shortcode addon main class
40
+ *
41
+ * @package events-calendar-shortcode
42
+ * @author Brian Hogg
43
+ * @version 1.0.10
44
+ */
45
+
46
+ if ( ! class_exists( 'Events_Calendar_Shortcode' ) ) {
47
+
48
+ class Events_Calendar_Shortcode
49
+ {
50
+ /**
51
+ * Current version of the plugin.
52
+ *
53
+ * @since 1.0.0
54
+ */
55
+ const VERSION = '1.8';
56
+
57
+ private $admin_page = null;
58
+
59
+ const MENU_SLUG = 'ecs-admin';
60
+
61
+ /**
62
+ * Constructor. Hooks all interactions to initialize the class.
63
+ *
64
+ * @since 1.0.0
65
+ * @access public
66
+ *
67
+ * @see add_shortcode()
68
+ */
69
+ public function __construct() {
70
+ add_action( 'plugins_loaded', array( $this, 'verify_tec_installed' ), 2 );
71
+ add_action( 'admin_menu', array( $this, 'add_menu_page' ), 1000 );
72
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_action_links' ) );
73
+ add_shortcode( 'ecs-list-events', array( $this, 'ecs_fetch_events' ) );
74
+ add_filter( 'ecs_ending_output', array( $this, 'add_event_schema_json' ), 10, 3 );
75
+ add_action( 'plugins_loaded', array( $this, 'load_languages' ) );
76
+ } // END __construct()
77
+
78
+ public function load_languages() {
79
+ if ( function_exists( 'tecsp_load_textdomain' ) )
80
+ return;
81
+ load_plugin_textdomain( 'the-events-calendar-shortcode', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
82
+ }
83
+
84
+ public function verify_tec_installed() {
85
+ if ( ! class_exists( 'Tribe__Events__Main' ) or ! defined( 'Tribe__Events__Main::VERSION' )) {
86
+ add_action( 'admin_notices', array( $this, 'show_tec_not_installed_message' ) );
87
+ }
88
+ }
89
+
90
+ public function show_tec_not_installed_message() {
91
+ if ( current_user_can( 'activate_plugins' ) ) {
92
+ $url = 'plugin-install.php?tab=plugin-information&plugin=the-events-calendar&TB_iframe=true';
93
+ $title = __( 'The Events Calendar', 'tribe-events-ical-importer' );
94
+ echo '<div class="error"><p>' . sprintf( esc_html( __( 'To begin using %s, please install the latest version of %s%s%s and add an event.', 'the-events-calendar-shortcode' ) ), 'The Events Calendar Shortcode', '<a href="' . esc_url( $url ) . '" class="thickbox" title="' . esc_attr( $title ) . '">', 'The Events Calendar', '</a>' ) . '</p></div>';
95
+ }
96
+ }
97
+
98
+ public function add_menu_page() {
99
+ if ( ! class_exists( 'Tribe__Settings' ) or ! method_exists( Tribe__Settings::instance(), 'should_setup_pages' ) or ! Tribe__Settings::instance()->should_setup_pages() ) {
100
+ return;
101
+ }
102
+
103
+ $page_title = esc_html__( 'Shortcode', 'the-events-calendar-shortcode' );
104
+ $menu_title = esc_html__( 'Shortcode', 'tribe-common' );
105
+ $capability = apply_filters( 'ecs_admin_page_capability', 'install_plugins' );
106
+
107
+ $where = Tribe__Settings::instance()->get_parent_slug();
108
+
109
+ $this->admin_page = add_submenu_page( $where, $page_title, $menu_title, $capability, self::MENU_SLUG, array( $this, 'do_menu_page' ) );
110
+
111
+ add_action( 'admin_print_styles-' . $this->admin_page, array( $this, 'enqueue' ) );
112
+ add_action( 'admin_print_styles', array( $this, 'enqueue_submenu_style' ) );
113
+ }
114
+
115
+ public function enqueue() {
116
+ wp_enqueue_style( 'ecs-admin-css', plugins_url( 'static/ecs-admin.css', __FILE__ ), array(), self::VERSION );
117
+ wp_enqueue_script( 'ecs-admin-js', plugins_url( 'static/ecs-admin.js', __FILE__ ), array(), self::VERSION );
118
+ }
119
+
120
+ /**
121
+ * Function to add a small CSS file to add some colour to the Shortcode submenu item
122
+ */
123
+ public function enqueue_submenu_style() {
124
+ wp_enqueue_style( 'ecs-submenu-css', plugins_url( 'static/ecs-submenu.css', __FILE__ ), array(), self::VERSION );
125
+ }
126
+
127
+ public function do_menu_page() {
128
+ include dirname( __FILE__ ) . '/templates/admin-page.php';
129
+ }
130
+
131
+ public function add_action_links( $links ) {
132
+ $mylinks = array();
133
+ if ( class_exists( 'Tribe__Settings' ) and method_exists( Tribe__Settings::instance(), 'should_setup_pages' ) and Tribe__Settings::instance()->should_setup_pages() )
134
+ $mylinks[] = '<a href="' . admin_url( 'edit.php?post_type=tribe_events&page=ecs-admin' ) . '">' . esc_html__( 'Settings', 'the-events-calendar-shortcode' ) . '</a>';
135
+ $mylinks[] = '<a target="_blank" style="color:#3db634; font-weight: bold;" href="https://eventcalendarnewsletter.com/the-events-calendar-shortcode/?utm_source=plugin-list&utm_medium=upgrade-link&utm_campaign=plugin-list&utm_content=action-link">' . esc_html__( 'Upgrade', 'the-events-calendar-shortcode' ) . '</a>';
136
+
137
+ return array_merge( $links, $mylinks );
138
+ }
139
+
140
+ /**
141
+ * Fetch and return required events.
142
+ * @param array $atts shortcode attributes
143
+ * @return string shortcode output
144
+ */
145
+ public function ecs_fetch_events( $atts ) {
146
+ /**
147
+ * Check if events calendar plugin method exists
148
+ */
149
+ if ( !function_exists( 'tribe_get_events' ) ) {
150
+ return '';
151
+ }
152
+
153
+ global $post;
154
+ $output = '';
155
+
156
+ $atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
157
+ 'cat' => '',
158
+ 'month' => '',
159
+ 'limit' => 5,
160
+ 'eventdetails' => 'true',
161
+ 'time' => null,
162
+ 'past' => null,
163
+ 'venue' => 'false',
164
+ 'author' => null,
165
+ 'schema' => 'true',
166
+ 'message' => 'There are no upcoming %s at this time.',
167
+ 'key' => 'End Date',
168
+ 'order' => 'ASC',
169
+ 'orderby' => 'startdate',
170
+ 'viewall' => 'false',
171
+ 'excerpt' => 'false',
172
+ 'thumb' => 'false',
173
+ 'thumbsize' => '',
174
+ 'thumbwidth' => '',
175
+ 'thumbheight' => '',
176
+ 'contentorder' => apply_filters( 'ecs_default_contentorder', 'title, thumbnail, excerpt, date, venue', $atts ),
177
+ 'event_tax' => '',
178
+ ), $atts ), $atts, 'ecs-list-events' );
179
+
180
+ // Category
181
+ if ( $atts['cat'] ) {
182
+ if ( strpos( $atts['cat'], "," ) !== false ) {
183
+ $atts['cats'] = explode( ",", $atts['cat'] );
184
+ $atts['cats'] = array_map( 'trim', $atts['cats'] );
185
+ } else {
186
+ $atts['cats'] = array( trim( $atts['cat'] ) );
187
+ }
188
+
189
+ $atts['event_tax'] = array(
190
+ 'relation' => 'OR',
191
+ );
192
+
193
+ foreach ( $atts['cats'] as $cat ) {
194
+ $atts['event_tax'][] = array(
195
+ 'taxonomy' => 'tribe_events_cat',
196
+ 'field' => 'name',
197
+ 'terms' => $cat,
198
+ );
199
+ $atts['event_tax'][] = array(
200
+ 'taxonomy' => 'tribe_events_cat',
201
+ 'field' => 'slug',
202
+ 'terms' => $cat,
203
+ );
204
+ }
205
+ }
206
+
207
+ // Past Event
208
+ $meta_date_compare = '>=';
209
+ $meta_date_date = current_time( 'Y-m-d H:i:s' );
210
+
211
+ if ( $atts['time'] == 'past' || !empty( $atts['past'] ) ) {
212
+ $meta_date_compare = '<';
213
+ }
214
+
215
+ // Key, used in filtering events by date
216
+ if ( str_replace( ' ', '', trim( strtolower( $atts['key'] ) ) ) == 'startdate' ) {
217
+ $atts['key'] = '_EventStartDate';
218
+ } else {
219
+ $atts['key'] = '_EventEndDate';
220
+ }
221
+
222
+ // Orderby
223
+ if ( str_replace( ' ', '', trim( strtolower( $atts['orderby'] ) ) ) == 'enddate' ) {
224
+ $atts['orderby'] = '_EventEndDate';
225
+ } elseif ( trim( strtolower( $atts['orderby'] ) ) == 'title' ) {
226
+ $atts['orderby'] = 'title';
227
+ } else {
228
+ $atts['orderby'] = '_EventStartDate';
229
+ }
230
+
231
+ // Date
232
+ $atts['meta_date'] = array(
233
+ array(
234
+ 'key' => $atts['key'],
235
+ 'value' => $meta_date_date,
236
+ 'compare' => $meta_date_compare,
237
+ 'type' => 'DATETIME'
238
+ )
239
+ );
240
+
241
+ // Specific Month
242
+ if ( 'current' == $atts['month'] ) {
243
+ $atts['month'] = current_time( 'Y-m' );
244
+ }
245
+ if ( 'next' == $atts['month'] ) {
246
+ $atts['month'] = date( 'Y-m', strtotime( '+1 months', current_time( 'timestamp' ) ) );
247
+ }
248
+ if ($atts['month']) {
249
+ $month_array = explode("-", $atts['month']);
250
+
251
+ $month_yearstr = $month_array[0];
252
+ $month_monthstr = $month_array[1];
253
+ $month_startdate = date( "Y-m-d", strtotime( $month_yearstr . "-" . $month_monthstr . "-01" ) );
254
+ $month_enddate = date( "Y-m-01", strtotime( "+1 month", strtotime( $month_startdate ) ) );
255
+
256
+ $atts['meta_date'] = array(
257
+ 'relation' => 'AND',
258
+ array(
259
+ 'key' => $atts['key'],
260
+ 'value' => $month_startdate,
261
+ 'compare' => '>=',
262
+ 'type' => 'DATETIME'
263
+ ),
264
+ array(
265
+ 'key' => $atts['key'],
266
+ 'value' => $month_enddate,
267
+ 'compare' => '<',
268
+ 'type' => 'DATETIME'
269
+ )
270
+ );
271
+ }
272
+
273
+ $atts = apply_filters( 'ecs_atts_pre_query', $atts, $meta_date_date, $meta_date_compare );
274
+ $posts = tribe_get_events( apply_filters( 'ecs_get_events_args', array(
275
+ 'post_status' => 'publish',
276
+ 'hide_upcoming' => true,
277
+ 'posts_per_page' => $atts['limit'],
278
+ 'tax_query'=> $atts['event_tax'],
279
+ 'meta_key' => ( ( trim( $atts['orderby'] ) and 'title' != $atts['orderby'] ) ? $atts['orderby'] : $atts['key'] ),
280
+ 'orderby' => ( $atts['orderby'] == 'title' ? 'title' : 'meta_value' ),
281
+ 'author' => $atts['author'],
282
+ 'order' => $atts['order'],
283
+ 'meta_query' => apply_filters( 'ecs_get_meta_query', array( $atts['meta_date'] ), $atts, $meta_date_date, $meta_date_compare ),
284
+ ), $atts, $meta_date_date, $meta_date_compare ) );
285
+ $posts = apply_filters( 'ecs_filter_events_after_get', $posts, $atts );
286
+
287
+ if ( $posts or apply_filters( 'ecs_always_show', false, $atts ) ) {
288
+ $output = apply_filters( 'ecs_beginning_output', $output, $posts, $atts );
289
+ $output .= apply_filters( 'ecs_start_tag', '<ul class="ecs-event-list">', $atts );
290
+ $atts['contentorder'] = explode( ',', $atts['contentorder'] );
291
+
292
+ foreach( (array) $posts as $post_index => $post ) {
293
+ setup_postdata( $post );
294
+ $event_output = '';
295
+ if ( apply_filters( 'ecs_skip_event', false, $atts, $post ) )
296
+ continue;
297
+ $category_slugs = array();
298
+ $category_list = get_the_terms( $post, 'tribe_events_cat' );
299
+ $featured_class = ( get_post_meta( get_the_ID(), '_tribe_featured', true ) ? ' ecs-featured-event' : '' );
300
+ if ( is_array( $category_list ) ) {
301
+ foreach ( (array) $category_list as $category ) {
302
+ $category_slugs[] = ' ' . $category->slug . '_ecs_category';
303
+ }
304
+ }
305
+ $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . implode( '', $category_slugs ) . $featured_class . apply_filters( 'ecs_event_classes', '', $atts, $post ) . '">', $atts, $post );
306
+
307
+ // Put Values into $event_output
308
+ foreach ( apply_filters( 'ecs_event_contentorder', $atts['contentorder'], $atts, $post ) as $contentorder ) {
309
+ switch ( trim( $contentorder ) ) {
310
+ case 'title':
311
+ $event_output .= apply_filters( 'ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post ) .
312
+ apply_filters( 'ecs_event_list_title_link_start', '<a href="' . tribe_get_event_link() . '" rel="bookmark">', $atts, $post ) . apply_filters( 'ecs_event_list_title', get_the_title(), $atts, $post ) . apply_filters( 'ecs_event_list_title_link_end', '</a>', $atts, $post ) .
313
+ apply_filters( 'ecs_event_title_tag_end', '</h4>', $atts, $post );
314
+ break;
315
+
316
+ case 'thumbnail':
317
+ if ( self::isValid( $atts['thumb'] ) ) {
318
+ $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : '';
319
+ $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : '';
320
+ if( !empty( $thumbWidth ) && !empty( $thumbHeight ) ) {
321
+ $event_output .= apply_filters( 'ecs_event_thumbnail', get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', array( $thumbWidth, $thumbHeight ), $atts, $post ) ), $atts, $post );
322
+ } else {
323
+ if ( $thumb = get_the_post_thumbnail( get_the_ID(), apply_filters( 'ecs_event_thumbnail_size', ( trim( $atts['thumbsize'] ) ? trim( $atts['thumbsize'] ) : 'medium' ), $atts, $post ) ) ) {
324
+ $event_output .= apply_filters( 'ecs_event_thumbnail_link_start', '<a href="' . tribe_get_event_link() . '">', $atts, $post );
325
+ $event_output .= apply_filters( 'ecs_event_thumbnail', $thumb, $atts, $post );
326
+ $event_output .= apply_filters( 'ecs_event_thumbnail_link_end', '</a>', $atts, $post );
327
+ }
328
+ }
329
+ }
330
+ break;
331
+
332
+ case 'excerpt':
333
+ if ( self::isValid( $atts['excerpt'] ) ) {
334
+ $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100;
335
+ $event_output .= apply_filters( 'ecs_event_excerpt_tag_start', '<p class="ecs-excerpt">', $atts, $post ) .
336
+ apply_filters( 'ecs_event_excerpt', self::get_excerpt( $excerptLength ), $atts, $post, $excerptLength ) .
337
+ apply_filters( 'ecs_event_excerpt_tag_end', '</p>', $atts, $post );
338
+ }
339
+ break;
340
+
341
+ case 'date':
342
+ if ( self::isValid( $atts['eventdetails'] ) ) {
343
+ $event_output .= apply_filters( 'ecs_event_date_tag_start', '<span class="duration time">', $atts, $post ) .
344
+ apply_filters( 'ecs_event_list_details', tribe_events_event_schedule_details(), $atts, $post ) .
345
+ apply_filters( 'ecs_event_date_tag_end', '</span>', $atts, $post );
346
+ }
347
+ break;
348
+
349
+ case 'venue':
350
+ if ( self::isValid( $atts['venue'] ) and function_exists( 'tribe_has_venue' ) and tribe_has_venue() ) {
351
+ $event_output .= apply_filters( 'ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post ) .
352
+ apply_filters( 'ecs_event_venue_at_tag_start', '<em> ', $atts, $post ) .
353
+ apply_filters( 'ecs_event_venue_at_text', __( 'at', 'the-events-calendar-shortcode' ), $atts, $post ) .
354
+ apply_filters( 'ecs_event_venue_at_tag_end', ' </em>', $atts, $post ) .
355
+ apply_filters( 'ecs_event_list_venue', tribe_get_venue(), $atts, $post ) .
356
+ apply_filters( 'ecs_event_venue_tag_end', '</span>', $atts, $post );
357
+ }
358
+ break;
359
+ case 'date_thumb':
360
+ if ( self::isValid( $atts['eventdetails'] ) ) {
361
+ $event_output .= apply_filters( 'ecs_event_date_thumb', '<div class="date_thumb"><div class="month">' . tribe_get_start_date( null, false, 'M' ) . '</div><div class="day">' . tribe_get_start_date( null, false, 'j' ) . '</div></div>', $atts, $post );
362
+ }
363
+ break;
364
+ default:
365
+ $event_output .= apply_filters( 'ecs_event_list_output_custom_' . strtolower( trim( $contentorder ) ), '', $atts, $post );
366
+ }
367
+ }
368
+ $event_output .= apply_filters( 'ecs_event_end_tag', '</li>', $atts, $post );
369
+ $output .= apply_filters( 'ecs_single_event_output', $event_output, $atts, $post, $post_index, $posts );
370
+ }
371
+ $output .= apply_filters( 'ecs_end_tag', '</ul>', $atts );
372
+ $output = apply_filters( 'ecs_ending_output', $output, $posts, $atts );
373
+
374
+ if( self::isValid( $atts['viewall'] ) ) {
375
+ $output .= apply_filters( 'ecs_view_all_events_tag_start', '<span class="ecs-all-events">', $atts ) .
376
+ '<a href="' . apply_filters( 'ecs_event_list_viewall_link', tribe_get_events_link(), $atts ) .'" rel="bookmark">' . apply_filters( 'ecs_view_all_events_text', sprintf( __( 'View All %s', 'the-events-calendar' ), tribe_get_event_label_plural() ), $atts ) . '</a>';
377
+ $output .= apply_filters( 'ecs_view_all_events_tag_end', '</span>' );
378
+ }
379
+
380
+ } else { //No Events were Found
381
+ $output .= apply_filters( 'ecs_no_events_found_message', sprintf( translate( $atts['message'], 'the-events-calendar' ), tribe_get_event_label_plural_lowercase() ), $atts );
382
+ } // endif
383
+
384
+ wp_reset_postdata();
385
+
386
+ return $output;
387
+ }
388
+
389
+ public function add_event_schema_json( $output, $posts, $atts ) {
390
+ if ( self::isValid( $atts['schema'] ) and $posts and class_exists( 'Tribe__Events__JSON_LD__Event' ) and ( ! defined( 'DOING_AJAX' ) or ! DOING_AJAX ) )
391
+ $output .= Tribe__Events__JSON_LD__Event::instance()->get_markup( $posts );
392
+ return $output;
393
+ }
394
+
395
+ /**
396
+ * Checks if the plugin attribute is valid
397
+ *
398
+ * @since 1.0.5
399
+ *
400
+ * @param string $prop
401
+ * @return boolean
402
+ */
403
+ public static function isValid( $prop )
404
+ {
405
+ return ( $prop !== 'false' );
406
+ }
407
+
408
+ /**
409
+ * Fetch and trims the excerpt to specified length
410
+ *
411
+ * @param integer $limit Characters to show
412
+ * @param string $source content or excerpt
413
+ *
414
+ * @return string
415
+ */
416
+ public static function get_excerpt( $limit, $source = null )
417
+ {
418
+ $excerpt = get_the_excerpt();
419
+ if( $source == "content" ) {
420
+ $excerpt = get_the_content();
421
+ }
422
+
423
+ $excerpt = preg_replace( " (\[.*?\])", '', $excerpt );
424
+ $excerpt = strip_tags( strip_shortcodes($excerpt) );
425
+ $excerpt = trim( preg_replace( '/\s+/', ' ', $excerpt ) );
426
+ if ( strlen( $excerpt ) > $limit ) {
427
+ $excerpt = substr( $excerpt, 0, $limit );
428
+ $excerpt .= '...';
429
+ }
430
+
431
+ return $excerpt;
432
+ }
433
+ }
434
+
435
+ }
436
+
437
+ /**
438
+ * Instantiate the main class
439
+ *
440
+ * @since 1.0.0
441
+ * @access public
442
+ *
443
+ * @var object $events_calendar_shortcode holds the instantiated class {@uses Events_Calendar_Shortcode}
444
+ */
445
+ global $events_calendar_shortcode;
446
+ $events_calendar_shortcode = new Events_Calendar_Shortcode();