{"id":23490,"date":"2012-08-09T12:07:40","date_gmt":"2012-08-09T19:07:40","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/"},"modified":"2012-08-16T08:41:04","modified_gmt":"2012-08-16T15:41:04","slug":"members-plugin-affect-output-loop-count-with-event-listings","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/","title":{"rendered":"Members Plugin &#8211; Affect Output Loop Count with Event Listings"},"content":{"rendered":"<p>Hi all,<br \/> I&#8217;m using Event Calendar (Pro) in conjunction with the Members plugin http:\/\/wordpress.org\/extend\/plugins\/members\/ When setting an event to be accessible by a certain user role, it hides the content (which is fine &#8211; works as expected). While not perfect (as it still shows all of the Event data, it&#8217;s a start.<\/p>\n<p>Members has a function that you can wrap around individual posts (or in the loop) like so:<\/p>\n<p>`$current_user = wp_get_current_user();<br \/> if(members_can_user_view_post( $current_user-&gt;ID, $post-&gt;ID ) == true) { }`<\/p>\n<p>Which allows us to check to see if the current user has access to a specific post &#8211; again, fine there and handy. What I&#8217;d like to know though is how I can hook into the Advanced Event List widget (for example) in a way that doesn&#8217;t effect the number of output items. For example, bringing over events-advanced-list-load-widget.php in my template and then \/events directory would allow to be put that access check around the element, but it is already counted towards the total you specify in the Widget options &#8211; so in theory, users could get 0 which is a little frustrating.<\/p>\n<p>Any help would be greatly appreciated. Thanks!<\/p>\n","protected":false},"template":"","class_list":["post-23490","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Members Plugin - Affect Output Loop Count with Event Listings -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Members Plugin - Affect Output Loop Count with Event Listings -\" \/>\n<meta property=\"og:description\" content=\"Hi all, I&#8217;m using Event Calendar (Pro) in conjunction with the Members plugin http:\/\/wordpress.org\/extend\/plugins\/members\/ When setting an event to be accessible by a certain user role, it hides the content (which is fine &#8211; works as expected). While not perfect (as it still shows all of the Event data, it&#8217;s a start. Members has a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/\" \/>\n<meta property=\"article:modified_time\" content=\"2012-08-16T15:41:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/\",\"name\":\"Members Plugin - Affect Output Loop Count with Event Listings -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2012-08-09T19:07:40+00:00\",\"dateModified\":\"2012-08-16T15:41:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Members Plugin &#8211; Affect Output Loop Count with Event Listings\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Members Plugin - Affect Output Loop Count with Event Listings -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/","og_locale":"en_US","og_type":"article","og_title":"Members Plugin - Affect Output Loop Count with Event Listings -","og_description":"Hi all, I&#8217;m using Event Calendar (Pro) in conjunction with the Members plugin http:\/\/wordpress.org\/extend\/plugins\/members\/ When setting an event to be accessible by a certain user role, it hides the content (which is fine &#8211; works as expected). While not perfect (as it still shows all of the Event data, it&#8217;s a start. Members has a [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/","article_modified_time":"2012-08-16T15:41:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/","name":"Members Plugin - Affect Output Loop Count with Event Listings -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2012-08-09T19:07:40+00:00","dateModified":"2012-08-16T15:41:04+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/members-plugin-affect-output-loop-count-with-event-listings\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Members Plugin &#8211; Affect Output Loop Count with Event Listings"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/23490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/23490\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=23490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}