false, 'public' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => EM_TAXONOMY_TAG_SLUG,'with_front'=>false), //'update_count_callback' => '', //'show_tagcloud' => true, //'show_in_nav_menus' => true, 'label' => __('Event Tags'), 'singular_label' => __('Event Tag'), 'labels' => array( 'name'=>__('Event Tags','events-manager'), 'singular_name'=>__('Event Tag','events-manager'), 'search_items'=>__('Search Event Tags','events-manager'), 'popular_items'=>__('Popular Event Tags','events-manager'), 'all_items'=>__('All Event Tags','events-manager'), 'parent_items'=>__('Parent Event Tags','events-manager'), 'parent_item_colon'=>__('Parent Event Tag:','events-manager'), 'edit_item'=>__('Edit Event Tag','events-manager'), 'update_item'=>__('Update Event Tag','events-manager'), 'add_new_item'=>__('Add New Event Tag','events-manager'), 'new_item_name'=>__('New Event Tag Name','events-manager'), 'separate_items_with_commas'=>__('Separate event tags with commas','events-manager'), 'add_or_remove_items'=>__('Add or remove events','events-manager'), 'choose_from_the_most_used'=>__('Choose from most used event tags','events-manager'), ), 'capabilities' => array( 'manage_terms' => 'edit_event_categories', 'edit_terms' => 'edit_event_categories', 'delete_terms' => 'delete_event_categories', 'assign_terms' => 'edit_events', ) )); } if( get_option('dbem_categories_enabled', true) ){ $supported_array = (EM_MS_GLOBAL && !is_main_site()) ? array():array(EM_POST_TYPE_EVENT,'event-recurring'); register_taxonomy(EM_TAXONOMY_CATEGORY,$supported_array,array( 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => EM_TAXONOMY_CATEGORY_SLUG, 'hierarchical' => true,'with_front'=>false), //'update_count_callback' => '', //'show_tagcloud' => true, //'show_in_nav_menus' => true, 'label' => __('Event Categories','events-manager'), 'singular_label' => __('Event Category','events-manager'), 'labels' => array( 'name'=>__('Event Categories','events-manager'), 'singular_name'=>__('Event Category','events-manager'), 'search_items'=>__('Search Event Categories','events-manager'), 'popular_items'=>__('Popular Event Categories','events-manager'), 'all_items'=>__('All Event Categories','events-manager'), 'parent_items'=>__('Parent Event Categories','events-manager'), 'parent_item_colon'=>__('Parent Event Category:','events-manager'), 'edit_item'=>__('Edit Event Category','events-manager'), 'update_item'=>__('Update Event Category','events-manager'), 'add_new_item'=>__('Add New Event Category','events-manager'), 'new_item_name'=>__('New Event Category Name','events-manager'), 'separate_items_with_commas'=>__('Separate event categories with commas','events-manager'), 'add_or_remove_items'=>__('Add or remove events','events-manager'), 'choose_from_the_most_used'=>__('Choose from most used event categories','events-manager'), ), 'capabilities' => array( 'manage_terms' => 'edit_event_categories', 'edit_terms' => 'edit_event_categories', 'delete_terms' => 'delete_event_categories', 'assign_terms' => 'edit_events', ) )); } $event_post_type = array( 'public' => true, 'hierarchical' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus'=>true, 'can_export' => true, 'exclude_from_search' => !get_option('dbem_cp_events_search_results'), 'publicly_queryable' => true, 'rewrite' => array('slug' => EM_POST_TYPE_EVENT_SLUG,'with_front'=>false), 'has_archive' => get_option('dbem_cp_events_has_archive', false) == true, 'supports' => apply_filters('em_cp_event_supports', array('custom-fields','title','editor','excerpt','comments','thumbnail','author')), 'capability_type' => 'event', 'capabilities' => array( 'publish_posts' => 'publish_events', 'edit_posts' => 'edit_events', 'edit_others_posts' => 'edit_others_events', 'delete_posts' => 'delete_events', 'delete_others_posts' => 'delete_others_events', 'read_private_posts' => 'read_private_events', 'edit_post' => 'edit_event', 'delete_post' => 'delete_event', 'read_post' => 'read_event', ), 'label' => __('Events','events-manager'), 'description' => __('Display events on your blog.','events-manager'), 'labels' => array ( 'name' => __('Events','events-manager'), 'singular_name' => __('Event','events-manager'), 'menu_name' => __('Events','events-manager'), 'add_new' => __('Add Event','events-manager'), 'add_new_item' => __('Add New Event','events-manager'), 'edit' => __('Edit','events-manager'), 'edit_item' => __('Edit Event','events-manager'), 'new_item' => __('New Event','events-manager'), 'view' => __('View','events-manager'), 'view_item' => __('View Event','events-manager'), 'search_items' => __('Search Events','events-manager'), 'not_found' => __('No Events Found','events-manager'), 'not_found_in_trash' => __('No Events Found in Trash','events-manager'), 'parent' => __('Parent Event','events-manager'), ), 'menu_icon' => 'dashicons-calendar', 'yarpp_support'=>true ); if ( get_option('dbem_recurrence_enabled') ){ $event_recurring_post_type = array( 'public' => apply_filters('em_cp_event_recurring_public', false), 'show_ui' => true, 'show_in_admin_bar' => true, 'show_in_menu' => 'edit.php?post_type='.EM_POST_TYPE_EVENT, 'show_in_nav_menus'=>false, 'publicly_queryable' => apply_filters('em_cp_event_recurring_publicly_queryable', false), 'exclude_from_search' => true, 'has_archive' => false, 'can_export' => true, 'hierarchical' => false, 'supports' => apply_filters('em_cp_event_supports', array('custom-fields','title','editor','excerpt','comments','thumbnail','author')), 'capability_type' => 'recurring_events', 'rewrite' => array('slug' => 'events-recurring','with_front'=>false), 'capabilities' => array( 'publish_posts' => 'publish_recurring_events', 'edit_posts' => 'edit_recurring_events', 'edit_others_posts' => 'edit_others_recurring_events', 'delete_posts' => 'delete_recurring_events', 'delete_others_posts' => 'delete_others_recurring_events', 'read_private_posts' => 'read_private_recurring_events', 'edit_post' => 'edit_recurring_event', 'delete_post' => 'delete_recurring_event', 'read_post' => 'read_recurring_event', ), 'label' => __('Recurring Events','events-manager'), 'description' => __('Recurring Events Template','events-manager'), 'labels' => array ( 'name' => __('Recurring Events','events-manager'), 'singular_name' => __('Recurring Event','events-manager'), 'menu_name' => __('Recurring Events','events-manager'), 'add_new' => __('Add Recurring Event','events-manager'), 'add_new_item' => __('Add New Recurring Event','events-manager'), 'edit' => __('Edit','events-manager'), 'edit_item' => __('Edit Recurring Event','events-manager'), 'new_item' => __('New Recurring Event','events-manager'), 'view' => __('View','events-manager'), 'view_item' => __('Add Recurring Event','events-manager'), 'search_items' => __('Search Recurring Events','events-manager'), 'not_found' => __('No Recurring Events Found','events-manager'), 'not_found_in_trash' => __('No Recurring Events Found in Trash','events-manager'), 'parent' => __('Parent Recurring Event','events-manager'), ) ); } if( get_option('dbem_locations_enabled', true) ){ $location_post_type = array( 'public' => true, 'hierarchical' => false, 'show_in_admin_bar' => true, //if in MS Global mode with locations shown on main blog, then the ui shouldn't be available on network blogs: 'show_ui' => !(EM_MS_GLOBAL && !is_main_site() && get_site_option('dbem_ms_mainblog_locations')), 'show_in_menu' => 'edit.php?post_type='.EM_POST_TYPE_EVENT, 'show_in_nav_menus'=>true, 'can_export' => true, 'exclude_from_search' => !get_option('dbem_cp_locations_search_results'), 'publicly_queryable' => true, 'rewrite' => array('slug' => EM_POST_TYPE_LOCATION_SLUG, 'with_front'=>false), 'query_var' => true, 'has_archive' => get_option('dbem_cp_locations_has_archive', false) == true, 'supports' => apply_filters('em_cp_location_supports', array('title','editor','excerpt','custom-fields','comments','thumbnail','author')), 'capability_type' => 'location', 'capabilities' => array( 'publish_posts' => 'publish_locations', 'delete_others_posts' => 'delete_others_locations', 'delete_posts' => 'delete_locations', 'delete_post' => 'delete_location', 'edit_others_posts' => 'edit_others_locations', 'edit_posts' => 'edit_locations', 'edit_post' => 'edit_location', 'read_private_posts' => 'read_private_locations', 'read_post' => 'read_location', ), 'label' => __('Locations','events-manager'), 'description' => __('Display locations on your blog.','events-manager'), 'labels' => array ( 'name' => __('Locations','events-manager'), 'singular_name' => __('Location','events-manager'), 'menu_name' => __('Locations','events-manager'), 'add_new' => __('Add Location','events-manager'), 'add_new_item' => __('Add New Location','events-manager'), 'edit' => __('Edit','events-manager'), 'edit_item' => __('Edit Location','events-manager'), 'new_item' => __('New Location','events-manager'), 'view' => __('View','events-manager'), 'view_item' => __('View Location','events-manager'), 'search_items' => __('Search Locations','events-manager'), 'not_found' => __('No Locations Found','events-manager'), 'not_found_in_trash' => __('No Locations Found in Trash','events-manager'), 'parent' => __('Parent Location','events-manager'), ), 'yarpp_support'=>true ); } if( strstr(EM_POST_TYPE_EVENT_SLUG, EM_POST_TYPE_LOCATION_SLUG) !== FALSE ){ //Now register posts, but check slugs in case of conflicts and reorder registrations register_post_type(EM_POST_TYPE_EVENT, $event_post_type); if ( get_option('dbem_recurrence_enabled') ){ register_post_type('event-recurring', $event_recurring_post_type); } if( get_option('dbem_locations_enabled', true) ){ register_post_type(EM_POST_TYPE_LOCATION, $location_post_type); } }else{ if( get_option('dbem_locations_enabled', true) ){ register_post_type(EM_POST_TYPE_LOCATION, $location_post_type); } register_post_type(EM_POST_TYPE_EVENT, $event_post_type); //Now register posts, but check slugs in case of conflicts and reorder registrations if ( get_option('dbem_recurrence_enabled') ){ register_post_type('event-recurring', $event_recurring_post_type); } } } //Post Customization function supported_event_custom_fields($supported){ $remove = array(); if( !get_option('dbem_cp_events_custom_fields') ) $remove[] = 'custom-fields'; if( !get_option('dbem_cp_events_comments') ) $remove[] = 'comments'; return supported_custom_fields($supported, $remove); } add_filter('em_cp_event_supports', 'supported_event_custom_fields',10,1); function supported_location_custom_fields($supported){ $remove = array(); if( !get_option('dbem_cp_locations_custom_fields') ) $remove[] = 'custom-fields'; if( !get_option('dbem_cp_locations_comments') ) $remove[] = 'comments'; return supported_custom_fields($supported, $remove); } add_filter('em_cp_location_supports', 'supported_location_custom_fields',10,1); function supported_custom_fields($supported, $remove = array()){ foreach($supported as $key => $support_field){ if( in_array($support_field, $remove) ){ unset($supported[$key]); } } return $supported; } function em_map_meta_cap( $caps, $cap, $user_id, $args ) { if( !empty( $args[0]) ){ /* Handle event reads */ if ( 'edit_event' == $cap || 'delete_event' == $cap || 'read_event' == $cap ) { $EM_Event = em_get_event($args[0],'post_id'); $post_type = get_post_type_object( $EM_Event->post_type ); /* Set an empty array for the caps. */ $caps = array(); //Filter according to event caps switch( $cap ){ case 'read_event': if ( 'private' != $EM_Event->post_status ) $caps[] = 'read'; elseif ( $user_id == $EM_Event->event_owner ) $caps[] = 'read'; else $caps[] = $post_type->cap->read_private_posts; break; case 'edit_event': if ( $user_id == $EM_Event->event_owner ) $caps[] = $post_type->cap->edit_posts; else $caps[] = $post_type->cap->edit_others_posts; break; case 'delete_event': if ( $user_id == $EM_Event->event_owner ) $caps[] = $post_type->cap->delete_posts; else $caps[] = $post_type->cap->delete_others_posts; break; } } if ( 'edit_recurring_event' == $cap || 'delete_recurring_event' == $cap || 'read_recurring_event' == $cap ) { $EM_Event = em_get_event($args[0],'post_id'); $post_type = get_post_type_object( $EM_Event->post_type ); /* Set an empty array for the caps. */ $caps = array(); //Filter according to recurring_event caps switch( $cap ){ case 'read_recurring_event': if ( 'private' != $EM_Event->post_status ) $caps[] = 'read'; elseif ( $user_id == $EM_Event->event_owner ) $caps[] = 'read'; else $caps[] = $post_type->cap->read_private_posts; break; case 'edit_recurring_event': if ( $user_id == $EM_Event->event_owner ) $caps[] = $post_type->cap->edit_posts; else $caps[] = $post_type->cap->edit_others_posts; break; case 'delete_recurring_event': if ( $user_id == $EM_Event->event_owner ) $caps[] = $post_type->cap->delete_posts; else $caps[] = $post_type->cap->delete_others_posts; break; } } if ( 'edit_location' == $cap || 'delete_location' == $cap || 'read_location' == $cap ) { $EM_Location = em_get_location($args[0],'post_id'); $post_type = get_post_type_object( $EM_Location->post_type ); /* Set an empty array for the caps. */ $caps = array(); //Filter according to location caps switch( $cap ){ case 'read_location': if ( 'private' != $EM_Location->post_status ) $caps[] = 'read'; elseif ( $user_id == $EM_Location->location_owner ) $caps[] = 'read'; else $caps[] = $post_type->cap->read_private_posts; break; case 'edit_location': if ( $user_id == $EM_Location->location_owner ) $caps[] = $post_type->cap->edit_posts; else $caps[] = $post_type->cap->edit_others_posts; break; case 'delete_location': if ( $user_id == $EM_Location->location_owner ) $caps[] = $post_type->cap->delete_posts; else $caps[] = $post_type->cap->delete_others_posts; break; } } } /* Return the capabilities required by the user. */ return $caps; } add_filter( 'map_meta_cap', 'em_map_meta_cap', 10, 4 );      $img_url, 'button'=>6), $atts); if( $img_url == $atts['img'] && $atts['button'] != 6 ){ $img_url = str_replace('gc_button6.gif', 'gc_button'.$atts['button'].'.gif', $img_url); } $url = '0'; return $url; } add_shortcode('events_gcal', 'em_get_gcal_shortcode'); /** * Generates a map of locations that match given query attributes. Accepts any location query attributes. * @param array $args * @return string */ function em_get_locations_map_shortcode($args){ $args['em_ajax'] = true; $args['query'] = 'GlobalMapData'; //get dimensions with px or % added in $width = (!empty($args['width'])) ? $args['width']:get_option('dbem_map_default_width','400px'); $width = preg_match('/(px)|%/', $width) ? $width:$width.'px'; $height = (!empty($args['height'])) ? $args['height']:get_option('dbem_map_default_height','300px'); $height = preg_match('/(px)|%/', $height) ? $height:$height.'px'; $args['width'] = $width; $args['height'] = $height; //assign random number for element id reference $args['random_id'] = substr(md5(rand().rand()),0,5); ob_start(); em_locate_template('templates/map-global.php',true, array('args'=>$args)); return ob_get_clean(); } add_shortcode('locations_map', 'em_get_locations_map_shortcode'); add_shortcode('locations-map', 'em_get_locations_map_shortcode'); //deprecate this... confusing for WordPress /** * Shows a list of events according to given specifications. Accepts any event query attribute. * @param array $args * @return string */ function em_get_events_list_shortcode($args, $format='') { $args = (array) $args; $args['ajax'] = isset($args['ajax']) ? $args['ajax']:(!defined('EM_AJAX') || EM_AJAX ); $args['format'] = ($format != '' || empty($args['format'])) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shortcode doesn't accept html $args['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_events_default_limit'); if( empty($args['format']) && empty($args['format_header']) && empty($args['format_footer']) ){ ob_start(); if( !empty($args['ajax']) ){ echo '
'; } //open AJAX wrapper em_locate_template('templates/events-list.php', true, array('args'=>$args)); if( !empty($args['ajax']) ) echo "
"; //close AJAX wrapper $return = ob_get_clean(); }else{ $args['ajax'] = false; $pno = ( !empty($args['pagination']) && !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : 1; $args['page'] = ( !empty($args['pagination']) && !empty($args['page']) && is_numeric($args['page']) )? $args['page'] : $pno; $return = EM_Events::output( $args ); } return $return; } add_shortcode ( 'events_list', 'em_get_events_list_shortcode' ); /** * Creates a grouped list of events by year, month, week or day * @since 4.213 * @param array $args * @param string $format * @return string */ function em_get_events_list_grouped_shortcode($args = array(), $format = ''){ $args = (array) $args; $args['ajax'] = isset($args['ajax']) ? $args['ajax']:(!defined('EM_AJAX') || EM_AJAX ); $args['format'] = ($format != '' || empty($args['format'])) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shortcode doesn't accept html $args['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_events_default_limit'); if( empty($args['format']) && empty($args['format_header']) && empty($args['format_footer']) ){ ob_start(); if( !empty($args['ajax']) ){ echo '
'; } //open AJAX wrapper em_locate_template('templates/events-list-grouped.php', true, array('args'=>$args)); if( !empty($args['ajax']) ) echo "
"; //close AJAX wrapper $return = ob_get_clean(); }else{ $args['ajax'] = false; $pno = ( !empty($args['pagination']) && !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : 1; $args['page'] = ( !empty($args['pagination']) && !empty($args['page']) && is_numeric($args['page']) )? $args['page'] : $pno; $return = EM_Events::output_grouped( $args ); } return $return; } add_shortcode ( 'events_list_grouped', 'em_get_events_list_grouped_shortcode' ); /** * Shows a list of events according to given specifications. Accepts any event query attribute. * @param array $atts * @return string */ function em_get_event_shortcode($atts, $format='') { global $EM_Event, $post; $return = ''; $the_event = is_object($EM_Event) ? clone($EM_Event):null; //save global temporarily $atts = (array) $atts; $atts['format'] = ($format != '' || empty($atts['format'])) ? $format : $atts['format']; $atts['format'] = html_entity_decode($atts['format']); //shorcode doesn't accept html if( !empty($atts['event']) && is_numeric($atts['event']) ){ $EM_Event = em_get_event($atts['event']); $return = ( !empty($atts['format']) ) ? $EM_Event->output($atts['format']) : $EM_Event->output_single(); }elseif( !empty($atts['post_id']) && is_numeric($atts['post_id']) ){ $EM_Event = em_get_event($atts['post_id'], 'post_id'); $return = ( !empty($atts['format']) ) ? $EM_Event->output($atts['format']) : $EM_Event->output_single(); } //no specific event or post id supplied, check globals if( !empty($EM_Event) ){ $return = ( !empty($atts['format']) ) ? $EM_Event->output($atts['format']) : $EM_Event->output_single(); }elseif( $post->post_type == EM_POST_TYPE_EVENT ){ $EM_Event = em_get_event($post->ID, 'post_id'); $return = ( !empty($atts['format']) ) ? $EM_Event->output($atts['format']) : $EM_Event->output_single(); } $EM_Event = is_object($the_event) ? $the_event:$EM_Event; //reset global return $return; } add_shortcode ( 'event', 'em_get_event_shortcode' ); /** * Returns list of locations according to given specifications. Accepts any location query attribute. */ function em_get_locations_list_shortcode( $args, $format='' ) { $args = (array) $args; $args['ajax'] = isset($args['ajax']) ? $args['ajax']:(!defined('EM_AJAX') || EM_AJAX ); $args['format'] = ($format != '' || empty($args['format'])) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shorcode doesn't accept html $args['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_locations_default_limit'); if( empty($args['format']) && empty($args['format_header']) && empty($args['format_footer']) ){ ob_start(); if( !empty($args['ajax']) ){ echo '
'; } //open AJAX wrapper em_locate_template('templates/locations-list.php', true, array('args'=>$args)); if( !empty($args['ajax']) ) echo "
"; //close AJAX wrapper $return = ob_get_clean(); }else{ $args['ajax'] = false; $args['page'] = ( !empty($args['pagination']) && !empty($args['page']) && is_numeric($args['page']) )? $args['page'] : 1; $args['page'] = ( !empty($args['pagination']) && !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : $args['page']; $return = EM_Locations::output( $args ); } return $return; } add_shortcode('locations_list', 'em_get_locations_list_shortcode'); /** * Shows a single location according to given specifications. Accepts any event query attribute. * @param array $atts * @return string */ function em_get_location_shortcode($atts, $format='') { $atts = (array) $atts; $atts['format'] = ($format != '' || empty($atts['format'])) ? $format : $atts['format']; $atts['format'] = html_entity_decode($atts['format']); //shorcode doesn't accept html if( !empty($atts['location']) && is_numeric($atts['location']) ){ $EM_Location = em_get_location($atts['location']); return ( !empty($atts['format']) ) ? $EM_Location->output($atts['format']) : $EM_Location->output_single(); }elseif( !empty($atts['post_id']) && is_numeric($atts['post_id']) ){ $EM_Location = em_get_location($atts['post_id'],'post_id'); return ( !empty($atts['format']) ) ? $EM_Location->output($atts['format']) : $EM_Location->output_single(); } //no specific location or post id supplied, check globals global $EM_Location, $post; if( !empty($EM_Location) ){ return ( !empty($atts['format']) ) ? $EM_Location->output($atts['format']) : $EM_Location->output_single(); }elseif( $post->post_type == EM_POST_TYPE_LOCATION ){ $EM_Location = em_get_location($post->ID,'post_id'); return ( !empty($atts['format']) ) ? $EM_Location->output($atts['format']) : $EM_Location->output_single(); } } add_shortcode ( 'location', 'em_get_location_shortcode' ); function em_get_categories_shortcode($args, $format=''){ $args = (array) $args; $args['ajax'] = isset($args['ajax']) ? $args['ajax']:(!defined('EM_AJAX') || EM_AJAX ); $args['format'] = ($format != '' || empty($args['format'])) ? $format : $args['format']; $args['format'] = html_entity_decode($args['format']); //shorcode doesn't accept html $args['orderby'] = !empty($args['orderby']) ? $args['orderby'] : get_option('dbem_categories_default_orderby'); $args['order'] = !empty($args['order']) ? $args['order'] : get_option('dbem_categories_default_order'); $args['pagination'] = isset($args['pagination']) ? $args['pagination'] : !isset($args['limit']); $args['limit'] = isset($args['limit']) ? $args['limit'] : get_option('dbem_categories_default_limit'); if( empty($args['format']) && empty($args['format_header']) && empty($args['format_footer']) ){ ob_start(); if( !empty($args['ajax']) ){ echo '
'; } //open AJAX wrapper em_locate_template('templates/categories-list.php', true, array('args'=>$args)); if( !empty($args['ajax']) ) echo "
"; //close AJAX wrapper $return = ob_get_clean(); }else{ $args['ajax'] = false; $args['page'] = ( !empty($args['pagination']) && !empty($args['page']) && is_numeric($args['page']) )? $args['page'] : 1; $args['page'] = ( !empty($args['pagination']) && !empty($_GET['pno']) && is_numeric($_GET['pno']) )? $_GET['pno'] : $args['page']; $return = EM_Categories::output($args); } return $return; } add_shortcode ( 'categories_list', 'em_get_categories_shortcode' ); /** * Shows a single location according to given specifications. Accepts any event query attribute. * @param array $atts * @return string */ function em_get_event_category_shortcode($atts, $format='') { $atts = (array) $atts; $atts['format'] = ($format != '' || empty($atts['format'])) ? $format : $atts['format']; $atts['format'] = html_entity_decode($atts['format']); //shorcode doesn't accept html if( !empty($atts['category']) && is_numeric($atts['category']) ){ $EM_Category = new EM_Category($atts['category']); return ( !empty($atts['format']) ) ? $EM_Category->output($atts['format']) : $EM_Category->output_single(); }elseif( !empty($atts['post_id']) && is_numeric($atts['post_id']) ){ $EM_Category = new EM_Category($atts['post_id'],'post_id'); return ( !empty($atts['format']) ) ? $EM_Category->output($atts['format']) : $EM_Category->output_single(); } } add_shortcode ( 'event_category', 'em_get_event_category_shortcode' ); /** * DO NOT DOCUMENT! This should be replaced with shortcodes events-link and events_uri * @param array $atts * @return string */ function em_get_events_page_shortcode($atts) { $atts = shortcode_atts ( array ('justurl' => 0, 'text' => '' ), $atts ); if($atts['justurl']){ return EM_URI; }else{ return em_get_link($atts['text']); } } add_shortcode ( 'events_page', 'em_get_events_page_shortcode' ); /** * Shortcode for a link to events page. Default will show events page title in link text, if you use [events_link]text[/events_link] 'text' will be the link text * @param array $atts * @param string $text * @return string */ function em_get_link_shortcode($atts, $text='') { return em_get_link($text); } add_shortcode ( 'events_link', 'em_get_link_shortcode'); /** * Returns the uri of the events page only * @return string */ function em_get_url_shortcode(){ return EM_URI; } add_shortcode ( 'events_url', 'em_get_url_shortcode'); /** * CHANGE DOCUMENTATION! if you just want the url you should use shortcode events_rss_uri * @param array $atts * @return string */ function em_get_rss_link_shortcode($atts) { $atts = shortcode_atts ( array ('justurl' => 0, 'text' => 'RSS' ), $atts ); if($atts['justurl']){ return EM_RSS_URI; }else{ return em_get_rss_link($atts['text']); } } add_shortcode ( 'events_rss_link', 'em_get_rss_link_shortcode' ); /** * Returns the uri of the events rss page only, takes no attributes. * @return string */ function em_get_rss_url_shortcode(){ return EM_RSS_URI; } add_shortcode ( 'events_rss_url', 'em_get_rss_url_shortcode'); /** * Creates a form to submit events with * @param array $atts * @return string */ function em_get_event_form_shortcode( $args = array() ){ return em_get_event_form( (array) $args ); } add_shortcode ( 'event_form', 'em_get_event_form_shortcode'); /** * Creates a form to search events with * @param array $atts * @return string */ function em_get_event_search_form_shortcode( $args = array() ){ return em_get_event_search_form( (array) $args ); } add_shortcode ( 'event_search_form', 'em_get_event_search_form_shortcode'); add_shortcode ( 'events_search', 'em_get_event_search_form_shortcode'); /** * Creates a form to search locations with * @param array $atts * @return string */ function em_get_location_search_form_shortcode( $args = array() ){ return em_get_location_search_form( (array) $args ); } add_shortcode ( 'location_search_form', 'em_get_location_search_form_shortcode'); add_shortcode ( 'locations_search', 'em_get_location_search_form_shortcode'); /** * Shows the list of bookings the user has made. Whilst maybe useful to some, the preferred way is to create a page and assign it as a my bookings page in your settings > pages > other pages section * @param array $atts * @return string */ function em_get_my_bookings_shortcode(){ return em_my_bookings(); } add_shortcode ( 'my_bookings', 'em_get_my_bookings_shortcode');       PHP Parse error: syntax error, unexpected '}' in C:\HostingSpaces\ranadheerreddy\ranadheerreddy.com\wwwroot\wp-content\plugins\events-manager\classes\em-bookings-table.php on line 348