How to hide some event by the query?
-
Hello,
I try to understand how the plugin is able to display only the events that are public for some groups and not the others.
For another page, I need to display only the events that are public according to the visitor’s group, but I can not find the missing argument in my query :<?php // THE LOOP : $posts_per_page = woffice_get_settings_option('blog_number'); $pagination_slug = (is_front_page()) ? 'page' : 'paged'; $paged = (get_query_var($pagination_slug)) ? get_query_var($pagination_slug) : 1; /** * Filter args of the blog posts query * * @param array $args * @param int $paged * @param int $posts_per_page */ $args = apply_filters('woffice_blog_query_args', array( 'post_type' => 'event', 'orderby' => 'meta_value', 'meta_key' => '_event_start_date', 'paged' => $paged, 'posts_per_page' => $posts_per_page ), $paged, $posts_per_page); $blog_query = new WP_Query($args); if ( $blog_query->have_posts() ) : ?> <?php while ( $blog_query->have_posts() ) : $blog_query->the_post(); ?> <?php // We check for the role : if (woffice_is_user_allowed()) { ?> <?php $blog_listing_content = woffice_get_settings_option('blog_listing_content','excerpt'); ?>
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘How to hide some event by the query?’ is closed to new replies.