• Resolved hwuser

    (@hwuser)


    Hello!

    I would like to know if, through any of your or PHP functions, I can modify the list or query of the calendar and the list of events, to personalize them according to the user id of each registered user.

    Greetings and thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support tristan083

    (@tristan083)

    Hi @hwuser,

    Thank you for reaching out.

    I am not sure of your particular use case, but the way I understand it, you should be able to make use of WordPress’ pre_get_posts filter to achieve what you’re trying to accomplish. You can find an example of this below, so please adjust as needed.

    add_action( 'pre_get_posts', function( $query ) {
      if ( is_admin() || ! $query->is_main_query() ) {
        return;
      }
    
      if ( $query->is_archive() && $query->is_post_type_archive( 'tribe_events' ) ) {
    $query->set ( 'tax_query', array(
                array(
                    'taxonomy' => 'tribe_events_cat',
                    'field'    => 'slug',
    				'terms'    => 'members-only'
                    'operator' => 'NOT IN'
                )
            )); 
      }
    });
    Plugin Support Darian

    (@d0153)

    Hi @hwuser

    It appears that we haven’t heard back from you in a while, so I’ll assume that the matter has been resolved. If you need any more help, feel free to start a new thread and we’ll be happy to assist you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Modify event list query’ is closed to new replies.