# s2member/260805/src/includes/menu-pages/code-samples/specific-post-restrictions.x-php

s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls &amp; Member Access Subscriptions, version 260805. 18 lines.

- Page: https://pluginprobe.com/plugins/s2member/260805/code/src/includes/menu-pages/code-samples/specific-post-restrictions.x-php
- Raw: https://pluginprobe.com/plugins/s2member/260805/raw/src/includes/menu-pages/code-samples/specific-post-restrictions.x-php
- Modified: 2016-11-29T22:22:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/s2member/260805/code/src/includes/menu-pages/code-samples/specific-post-restrictions.x-php#L10-L20`.

```
<?php
if ($posts = get_posts ())
	{
		foreach ($posts as $post)
			{
				if (!is_permitted_by_s2member ($post->ID, "post"))
					continue;
				/* Skip it. The current User/Member
				CANNOT access this particular Post. */

				$post_or_page_id = $post->ID;
				if (!is_permitted_by_s2member ($post_or_page_id, "singular"))
					continue;
				/* The "singular" attribute can check both Pages and Posts the same time.
				So if this was actually a "Page", that would be valid, w/ "singular". */
			}
	}
?>
```
