• Resolved jurvrn

    (@jurvrn)


    How can you do to limits returned results of calendar to a specific owner, identified by their current authorized name? automatically without specifying its ID manually.

    [events_calendar full=1 owner=USER]

    Please make this option

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    You can also modify template file at events-manager/templates/templates/calendar-full.php line 44 try to change

    
    <?php echo EM_Events::output($cell_data['events'],array('format'=>get_option('dbem_full_calendar_event_format'))); ?>
    

    To

    
    <?php echo EM_Events::output($cell_data['events'],array('owner'=>1,'format'=>get_option('dbem_full_calendar_event_format'))); ?>
    

    Where ‘owner’=>1 is the currently logged-in user-id; unfortunately, this might not work as expected to guest users.

    to use templates: https://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/templates/calendar-full.php

    Thread Starter jurvrn

    (@jurvrn)

    Thanks, angelo_nwl (@angelo_nwl) !
    I made

    0:/d919180q.beget.tech/public_html/wp-content/themes/easywp/plugins/events-manager/templates/calendar-full.php

    and replace

    .....
    <ul>
    <?php echo EM_Events::output($cell_data['events'],array('owner'=>1,'format'=>get_option('dbem_full_calendar_event_format'))); ?>
    <?php if( $args['limit'] ......

    but all users see events added by other users ??

    Thread Starter jurvrn

    (@jurvrn)

    angelo_nwl (@angelo_nwl)
    If I put the shortcode [events_calendar full=1 owner=1/2/3…] into the page or widget – events are shown those added by the user with the number 1/2/3…
    But I need the number to be determined automatically that user is logged on on the site.
    It could be done in /wp-content/themes/easywp/plugins/events-manager/templates/calendar-full.php , but there does not work array('owner'=>1,… and use get_current_user_id

    $cur_user_id = get_current_user_id();
    <?php echo EM_Events::output($cell_data[‘events’],array(‘owner’=>$cur_user_id,’format’=>get_option(‘dbem_full_calendar_event_format’))); ?>

    • This reply was modified 3 years, 8 months ago by jurvrn.
    Thread Starter jurvrn

    (@jurvrn)

    Good day, angelo_nwl (@angelo_nwl)

    The code dont’t work ??

    <?php echo EM_Events::output($cell_data[‘events’],array(‘owner’=>1,’format’=>get_option(‘dbem_full_calendar_event_format’))); ?>

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Let me try to re-check this one and get back to you here.

    Thread Starter jurvrn

    (@jurvrn)

    angelo_nwl (@angelo_nwl),
    If the code is used:
    echo EM_Events::output($cell_data['events'],array('owner'=>get_current_user_id(),'format'=>get_option('dbem_full_calendar_event_format')));
    that code:

    var_dump(array('owner'=>get_current_user_id()));
    var_dump(array_search (get_current_user_id(),array('owner'=>get_current_user_id())));

    gives out the result:

    array(1) { ["owner"]=> int(2) }
    string(5) "owner" 

    That is, we see that the user ID is determined and used when executing the code, but there is no result.

    P.S. If using array(‘owner’=>”me”,… then the same

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Thanks for the update, currently checking on this.

    Thread Starter jurvrn

    (@jurvrn)

    angelo_nwl (@angelo_nwl) gracias, todo funciona bien

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Limits returned results of calendar to a active owner’ is closed to new replies.