EventON Shortcodes

Below, you’ll find a detailed guide on how to add the EventON Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the EventON Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the EventON Plugin and the shortcodes it provides:

Plugin Icon
EventON

"EventON is a versatile WordPress plugin designed for creating and managing events on your website with ease. Its lightweight, user-friendly interface makes event planning a breeze."

★★★☆✩ (16) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [add_ajde_evcal]
  • [add_eventon_list]
  • [add_single_eventon]
  • [add_eventon_now]
  • [add_eventon_sv]
  • [test_eventon_shortcode]
  • [add_eventon_search]

EventON [add_ajde_evcal] Shortcode

The Eventon Lite plugin shortcode ‘add_ajde_evcal’ is designed to display a calendar. It accepts an array of parameters to customize the output. The PHP function ‘eventon_show_calendar’ is associated with this shortcode. It checks if the passed argument is an array and if not, an empty array is created. The function then sets the ‘number_of_months’ to ‘1’, ‘sep_month’ to ‘no’, and ‘calendar_type’ to ‘default’. It returns the initial calendar view.

Shortcode: [add_ajde_evcal]

Parameters

Here is a list of all possible add_ajde_evcal shortcode parameters and attributes:

  • number_of_months – Defines how many months to display on the calendar.
  • sep_month – Determines whether to separate months visually or not.
  • calendar_type – Sets the type of calendar to display, default is standard view.

Examples and Usage

Basic Example – Displaying a single month event calendar with default settings.

[add_ajde_evcal]

Advanced Examples

Displaying a single month event calendar with a specific number of months and separated month view.

[add_ajde_evcal number_of_months=3 sep_month=yes]

Displaying a single month event calendar with a specific calendar type. The calendar type can be ‘default’, ‘minimal’, ‘fullwidth’, etc.

[add_ajde_evcal calendar_type=minimal]

Combining multiple parameters to customize the event calendar display.

[add_ajde_evcal number_of_months=2 sep_month=yes calendar_type=fullwidth]
These shortcode examples demonstrate the flexibility and customization options available with the ‘add_ajde_evcal’ shortcode. By adjusting the parameters, you can tailor the event calendar to fit your specific needs.

PHP Function Code

In case you have difficulties debugging what causing issues with [add_ajde_evcal] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_ajde_evcal',array($this,'eventon_show_calendar'));	// for eventon ver < 2.0.8

Shortcode PHP function:

                    function eventon_show_calendar($A){
			if(empty($A) || !is_array($A)) $A = array();
			
			$A['number_of_months'] = '1';
			$A['sep_month'] = 'no';
			$A['calendar_type'] = 'default';

			return EVO()->calendar->_get_initial_calendar($A );
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [add_eventon_list] Shortcode

The Eventon-lite plugin shortcode, 'add_eventon_list', is used to generate a list of events. It takes an array of attributes, which if empty or not an array, is set to an empty array. The 'calendar_type' attribute is set to 'list', instructing the generator to create a list of events. It then calls the 'generate_events_list' function with the attributes and returns the generated list.

Shortcode: [add_eventon_list]

Examples and Usage

Basic example - Utilize the EventOn Lite plugin's shortcode to generate a basic event list.

[add_eventon_list /]

Advanced examples

Use the shortcode to display a specific type of event list by adding the 'calendar_type' attribute. In this case, we are generating a list type calendar.

[add_eventon_list calendar_type="list" /]

Further customize the event list by adding multiple attributes. Here, we are generating a list type calendar that only shows events from a specific category and limits the number of events displayed to 5.

[add_eventon_list calendar_type="list" event_category_id="3" event_count="5" /]

Note: Replace '3' with the ID of your desired event category and '5' with the number of events you wish to display.

PHP Function Code

In case you have difficulties debugging what causing issues with [add_eventon_list] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_eventon_list',array($this,'events_list'));

Shortcode PHP function:

                    function events_list($atts){
			
			if(empty($atts) || !is_array($atts)) $atts = array();
			
			ob_start();	
			
			$atts['calendar_type'] = 'list';
			
			echo EVO()->evo_generator->generate_events_list($atts);	

			return ob_get_clean();	
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [add_single_eventon] Shortcode

The EventON Lite shortcode 'add_single_eventon' is used to display a single event's details on a page or post. It extracts event information like time, location, and organizers, and displays it in an organized layout.

Shortcode: [add_single_eventon]

Parameters

Here is a list of all possible add_single_eventon shortcode parameters and attributes:

  • id - Specifies the unique identifier of the event.
  • ep_display_style - Determines the display style of the event.
  • event_datavals - Holds specific event data values.
  • ep_data_fields - Contains data fields of the event.
  • repeat_interval - Defines the event's repeating interval.
  • event_parts - If set to 'yes', it shows only parts of the event.
  • open_as_popup - If set to 'yes', the event opens as a popup.
  • ev_uxval - Determines the user interaction for the event box.
  • ext_url - External link for the event.
  • show_exp_evc - If set to 'yes', it shows the expanded event card.
  • show_excerpt - If set to 'yes', it shows the event excerpt.
  • show_exp_evc - If set to 'yes', it expands the event card.

Examples and Usage

Basic example - Displaying a single event with the event ID.

[add_single_eventon id=1 /]

Under the title 'Advanced examples', you can use the shortcode to display single event details by referencing the event ID, language, and repeat interval. If the event is recurring, the repeat_interval attribute will specify which instance of the event to display. The event will load according to the language specified.

[add_single_eventon id=1 lang="en" repeat_interval=2 /]

You can also manipulate the user interaction for the event box. For example, if you want the event to open as a popup, you can set the 'open_as_popup' attribute to 'yes'. If you want to override the expended event card, you can set the 'show_exp_evc' attribute to 'no'.

[add_single_eventon id=1 open_as_popup=yes show_exp_evc=no /]

Furthermore, you can use the shortcode to display specific parts of the event by setting the 'event_parts' attribute to 'yes'.

[add_single_eventon id=1 event_parts=yes /]

If you want to display the event with an external link, you can set the 'ev_uxval' attribute to '2' and provide the external URL using the 'ext_url' attribute.

[add_single_eventon id=1 ev_uxval=2 ext_url="http://example.com" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [add_single_eventon] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_single_eventon', array($this,'single_event_box'));

Shortcode PHP function:

                    function single_event_box($atts){
			extract($atts);

			if(empty($id)) return;

			// if just data parts @4.5
			if( !empty($ep_display_style) && $ep_display_style == '1' && !empty($event_datavals) && !empty($ep_data_fields) ){

				EVO()->calendar->process_arguments( $atts);	
				$args = EVO()->calendar->shortcode_args;
				extract($args);

				$event_id = (int)$id;
				$event_ri = !empty($repeat_interval) ? (int)$repeat_interval:'0';

				ob_start();

				$fields = explode(',', $ep_data_fields);
				if( is_array($fields)){

					$EVENT = new EVO_Event($event_id,'', $event_ri );

					

					foreach($fields as $ff){
						switch ($ff) {
						case 'event_time':
							echo $EVENT->get_formatted_smart_time();
							break;

						case 'event_stime':
							$start = $EVENT->get_start_time();
							echo $EVENT->get_readable_formatted_date( $start);
						break;
						case 'event_etime':
							$start = $EVENT->get_end_time();
							echo $EVENT->get_readable_formatted_date( $start);
						break;
						case 'event_link':
							echo $EVENT->get_permalink($event_ri, $lang);
						break;
						case 'event_subtitle':
							echo $EVENT->get_subtitle();
						break;
						case 'event_location_name':
							echo $EVENT->get_location_name();
						break;
						case 'event_location_add':
							echo $EVENT->get_location_address();
						break;
						case 'event_organizers':
							$names = $EVENT->get_organizer_names();
							if( $names && is_array($names)){
								echo implode(', ', $names);
							}
						break;
						}
					}
				}

				return ob_get_clean();

			}

			// regular event box

			EVO()->frontend->load_evo_scripts_styles();		
			
			add_filter('eventon_shortcode_defaults', array($this,'shortcode_defaults_single_event'), 10, 1);
			
			EVO()->calendar->process_arguments( $atts);	
			$args = EVO()->calendar->shortcode_args;

			// intial checks
				if(empty($args['id'])) return false; // when the id value was not passed



			// show just parts of the event
				$is_event_parts = isset($atts['event_parts'] ) && $atts['event_parts'] == 'yes' ? true:false;
				if($is_event_parts){
					$args['show_exp_evc'] = 'yes';
				}
					


			// user interaction for this event box
				$ev_uxval = 4; // default open as event page
				$external_url = '';
				if( $args['open_as_popup']=='yes' || $args['ev_uxval']==3){
					$ev_uxval = 3;
					$args['show_exp_evc'] = 'no';// override expended event card
				}elseif(  $args['ev_uxval']=='X'){
					$ev_uxval = 'X';
				}elseif(  $args['ev_uxval']=='2' && !empty($args['ext_url'])){// external link
					$ev_uxval = '2';
					$external_url = $args['ext_url'];
				}elseif(  $args['ev_uxval']=='1' ){// slidedown
					$ev_uxval = 1;
				}

				// update calendar ux_val to 4 so eventcard HTML content will not load on eventbox
				if( ($ev_uxval==3 && $args['show_exp_evc']!='no') || $ev_uxval==1){}else{
					EVO()->evo_generator->process_arguments(array('ux_val'=>4));	
				}
					

			EVO()->evo_generator->is_eventcard_hide_forcer= true;
			$opt = EVO()->evo_generator->evopt1;

				// google map variables
				$evcal_gmap_format = ($opt['evcal_gmap_format']!='')?$opt['evcal_gmap_format']:'roadmap';	
				$evcal_gmap_zooml = ($opt['evcal_gmap_zoomlevel']!='')?$opt['evcal_gmap_zoomlevel']:'12';	
					
				$evcal_gmap_scrollw = (!empty($opt['evcal_gmap_scroll']) && $opt['evcal_gmap_scroll']=='yes')?'false':'true';				
			// get individual event content from calendar generator function
				$modified_event_ux = ($args['show_exp_evc']=='yes'  )? null: 4;
				$event = EVO()->evo_generator->get_single_event_data(
					$args['id'], 
					$args['lang'],
					$args['repeat_interval'],
					$args
				);
			
			// other event box variables
			$ev_excerpt = ($args['show_excerpt']=='yes')? "data-excerpt='1'":null;
			$ev_expand = ($args['show_exp_evc']=='yes')? "data-expanded='1'":null;
				
			$SC = array(
				'excerpt'=>$args['show_excerpt'],
				'expanded'=>$args['show_exp_evc'],	
				'ux_val'=>$ev_uxval,	
				'exturl'=>$external_url,	
				'mapscroll'=>$evcal_gmap_scrollw,	
				'mapformat'=>$evcal_gmap_format,	
				'mapzoom'=>$evcal_gmap_zooml,	
				'maps_load' => (EVO()->calendar->google_maps_load ? 'yes':'no')
			);


			// Calendar Class Names
				$__cal_classes = array('ajde_evcal_calendar','eventon_single_event','eventon_event','evo_sin_box');

				$__cal_classes = EVO()->calendar->body->_get_calendar_classes( $__cal_classes, $args);

				if( $is_event_parts) $__cal_classes[] = 'event_parts';

				$_cal_classes_string = implode(' ', $__cal_classes);

			
			ob_start();
				
			echo "<div class='{$_cal_classes_string}' >";
			echo "<div class='evo-data' ".$ev_excerpt." ".$ev_expand." data-ux_val='{$ev_uxval}' data-exturl='{$external_url}' data-mapscroll='".$evcal_gmap_scrollw."' data-mapformat='".$evcal_gmap_format."' data-mapzoom='".$evcal_gmap_zooml."' ></div><div class='evo_cal_data' data-sc='". json_encode($SC)."'></div>";
			echo "<div id='evcal_list' class='eventon_events_list ".($ev_uxval=='X'?'noaction':null)."'>";
			echo (isset($event) && isset($event[0]) ) ? $event[0]['content']: __('Missing Event Data','eventon');
			echo "</div></div>";
				
			
			return ob_get_clean();
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [add_eventon_now] Shortcode

The EventOn Now shortcode is a dynamic tool that displays live events on your WordPress site. It initializes an Evo_Calendar_Now object to fetch and display live events.

Shortcode: [add_eventon_now]

Examples and Usage

Basic Example - Displaying the current live events with the default settings.

[add_eventon_now]

Advanced Examples

Displaying the current live events with custom parameters. In this example, we are passing an array to the shortcode with the key 'calendar_type' set to 'live'.

[add_eventon_now calendar_type="live"]

In this next example, we will show how to use the shortcode with multiple parameters. We are passing an array to the shortcode with the keys 'calendar_type' set to 'live' and 'event_type' set to 'music'. This will display all live music events.

[add_eventon_now calendar_type="live" event_type="music"]

Please note that the parameters you can use depend on the ones that are accepted by the Evo_Calendar_Now class in the EventON plugin. Always check the plugin's documentation for the most accurate information.

PHP Function Code

In case you have difficulties debugging what causing issues with [add_eventon_now] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_eventon_now', array($this,'eventon_now'));

Shortcode PHP function:

                    function eventon_now($A){
			if(empty($A) || !is_array($A)) $A = array();

			$A['calendar_type'] = 'live';

			$calnow = new Evo_Calendar_Now();
			return $calnow->get_cal( $A);
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [add_eventon_sv] Shortcode

The EventOn Lite plugin shortcode, 'add_eventon_sv', allows you to display a one-month event schedule. It ignores any passed parameters and sets the number of months to '1', the 'sep_month' to 'no', and the 'calendar_type' to 'schedule'.

Shortcode: [add_eventon_sv]

Parameters

Here is a list of all possible add_eventon_sv shortcode parameters and attributes:

  • number_of_months - Defines the number of months to display.
  • sep_month - Option to separate each month in the view.
  • calendar_type - Specifies the type of calendar, in this case, it's 'schedule'.

Examples and Usage

Basic example - Displaying a single month schedule view of events using the EventOn SV shortcode.

[add_eventon_sv]

With the basic shortcode usage, you will get a schedule view of the current month's events. The events will be displayed in a list format.

Advanced examples

Displaying a single month schedule view of events with specified parameters to customize the output. In this example, we are setting the number of months to display to 1, separating each month into its own section, and specifying the calendar type as schedule.

[add_eventon_sv number_of_months='1' sep_month='no' calendar_type='schedule']

In this advanced example, the shortcode will display a schedule view of events for one month. The events will not be separated by month and will be displayed in a schedule format.

PHP Function Code

In case you have difficulties debugging what causing issues with [add_eventon_sv] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_eventon_sv', array($this,'schedule_view'));

Shortcode PHP function:

                    function schedule_view($A){
			if(empty($A) || !is_array($A)) $A = array();
			
			$A['number_of_months'] = '1';
			$A['sep_month'] = 'no';
			$A['calendar_type'] = 'schedule';

			//$schedule = new Evo_Cal_Schedule();
			return EVO()->evosv->run($A);
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [test_eventon_shortcode] Shortcode

The 'test_eventon_shortcode' is a simple, yet effective tool. It's a shortcode that generates a paragraph element with the text "-- Shortcode content generation is working fine --".

Shortcode: [test_eventon_shortcode]

Examples and Usage

Basic example - The basic usage of the 'test_eventon_shortcode' shortcode does not require any parameters. It simply returns a text indicating that the shortcode content generation is working fine.

[test_eventon_shortcode /]

Advanced examples

Displaying a text message by passing it as a parameter. The shortcode will return the passed text wrapped within a paragraph HTML tag.

[test_eventon_shortcode text="Hello, World!" /]

Using the shortcode with two parameters, 'text' and 'color'. The shortcode will return the passed text in the specified color.

[test_eventon_shortcode text="Hello, World!" color="red" /]

Note: The above examples assume that the 'test_shortcode' function can handle parameters. In reality, the function needs to be modified to accept and process parameters.

PHP Function Code

In case you have difficulties debugging what causing issues with [test_eventon_shortcode] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('test_eventon_shortcode', array($this,'test_shortcode'));

Shortcode PHP function:

                    function test_shortcode(){
			return "<p>-- Shortcode content generation is working fine --</p>";
		}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-evo-shortcodes.php

EventON [add_eventon_search] Shortcode

The Eventon Lite shortcode 'add_eventon_search' generates a search field within a WordPress site. It enables users to search for calendar events. The PHP function 'search_content' is called when this shortcode is used. It initializes the search field and sets default search parameters. It also loads necessary scripts and styles from the Eventon plugin. The search field allows users to search for events and displays the number of events found.

Shortcode: [add_eventon_search]

Parameters

Here is a list of all possible add_eventon_search shortcode parameters and attributes:

  • event_type - Determines the type of event to display
  • event_type_2 - Secondary event type to display
  • number_of_months - The number of months to include in the search
  • search_all - If set to 'yes', all events are searched
  • hide_mult_occur - If 'yes', hides multiple occurrences of the same event
  • lang - Specifies the language used for the plugin

Examples and Usage

Basic example - This example shows how to use the 'add_eventon_search' shortcode with default parameters.

[add_eventon_search]

Advanced example 1 - This example demonstrates how to use the 'add_eventon_search' shortcode with custom parameters. Here, we are setting the event type to 'conference', the secondary event type to 'webinar', and the number of months to display to 6.

[add_eventon_search event_type="conference" event_type_2="webinar" number_of_months="6"]

Advanced example 2 - This example showcases the usage of the 'add_eventon_search' shortcode with a different language. Here, we are setting the language to 'L2'.

[add_eventon_search lang="L2"]

Advanced example 3 - In this example, we are using the 'add_eventon_search' shortcode to show all events, including multiple occurrences of the same event. We achieve this by setting 'search_all' to 'yes' and 'hide_mult_occur' to 'no'.

[add_eventon_search search_all="yes" hide_mult_occur="no"]

PHP Function Code

In case you have difficulties debugging what causing issues with [add_eventon_search] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('add_eventon_search', array($this, 'search_content'), 10, 1);

Shortcode PHP function:

                    function search_content($atts){
		ob_start(); 

		// enqueue required eventon scripts
		EVO()->frontend->load_evo_scripts_styles();
		

		$defaults = array(
			'event_type'=>'all',
			'event_type_2'=>'all',
			'number_of_months'=>12,
			'search_all'=>'no',
			'hide_mult_occur'=>'yes',
			'lang'=>'L1',
		);


		$sc_data = is_array($atts) ? array_merge($defaults, $atts): $defaults;
		EVO()->lang = $sc_data['lang'];
		
			
		?>
		<div id='evo_search' class='EVOSR_section '>
			<div class="evo_search_entry">
				<p class='evosr_search_box' >
					<input class='evo_search_field' type="text" placeholder='<?php echo evo_lang_get('evoSR_001a','Search Calendar Events');?>' data-role="none">
					<a class='evo_do_search'><i class="fa fa-search"></i></a>
					<span class="evosr_blur"></span>
					<span class="evosr_blur_process"></span>
					<span class="evosr_blur_text"><?php echo evo_lang_get('evoSR_002','Searching');?></span>
					<span style="display:none" class='data' data-sc='<?php echo json_encode($sc_data);?>'></span>
				</p>
				<p class='evosr_msg' style='display:none'><?php echo evo_lang_get('evoSR_003','What do you want to search for?');?></p>
			</div>


			<p class="evo_search_results_count" style='display:none'><span>10</span> <?php echo evo_lang_get('evoSR_004','Event(s) found');?></p>
			<div class="evo_search_results"></div>
		</div>
		<?php
		return ob_get_clean();
	}
                    

Code file location:

eventon-lite/eventon-lite/includes/class-search.php

Conclusion

Now that you've learned how to embed the EventON Plugin shortcodes, understood the parameters, and seen code examples, it's easy to use and debug any issue that might cause it to 'not work'. If you still have difficulties with it, don't hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *