Support » Plugin: Events Manager » events-recurring permalink problem

  • tayssir.ch

    (@tayssirch)


    Hello,
    I am using your plugin to display courses not (events)
    i am using recurring events,
    i added this function to display List of Recurring Events as one Event

    function em_get_events_list_shortcode_all($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
    	$atts['page'] = ( !empty($atts['page']) && is_numeric($atts['page']) )? $atts['page'] : 1;
    	$atts['page'] = ( !empty($_GET['page']) && is_numeric($_GET['page']) )? $_GET['page'] : $atts['page'];        
    
            // get recurrence events
            $atts['recurring']=1;
            $evts_recurring=EM_Events::get($atts);
    
            // get non-recurrence events
            $atts['recurring']=0;
            $evts=EM_Events::get($atts);
            // filter out the events that are instances of recurring events
            $non_recurrence_evts = array_filter($evts,'is_no_recurrence');
    
            // merge recurrence and non-recurring events
            $evts_all= array_merge($non_recurrence_evts,$evts_recurring);
            // sort them by start==start date+time
            usort($evts_all,'evt_start_sort');
    
            //
    	return EM_Events::output( $evts_all, $atts );
    }
    add_shortcode ( 'events_list_all', 'em_get_events_list_shortcode_all' );
    
    function is_no_recurrence($evt) {
        return $evt->recurrence_id == null;
    }
    
    function evt_start_sort($evt1, $evt2) {
        return $evt1->start > $evt2->start;
    }
    
    function filter_condition($show_condition, $condition, $conditionals_key, $thiss) {
    
        if ($condition == "is_recurring") {
            $show_condition=$thiss->recurrence == 1;
        }
        return $show_condition;
    }
    add_filter('em_event_output_show_condition', 'filter_condition',10,4);

    Also i am using also this shortcode in taxonomy-event-categories.php

    <?php echo do_shortcode('[events_list_all recurring="1"]<tr><td> <a href="#_EVENTURL">#_EVENTNAME</a></td><td> #F #d {is_recurring}- #@F #@d{/is_recurring}</td></tr>[/events_list_all]'); ?>

    After adding the function, and using this shortcode “event_list_all” in index.php and taxonomy-event-categories.php, events permalink is wrong

    http://domain-name.com/events-recurring/course-title/
    it should be :
    http://domain-name.com/courses/course-title-2016-01-04/

    any help please?

    https://wordpress.org/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘events-recurring permalink problem’ is closed to new replies.