# s2member/110812/includes/menu-pages/code-samples/specific-post-restrictions.php

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

- Page: https://pluginprobe.com/plugins/s2member/110812/code/includes/menu-pages/code-samples/specific-post-restrictions.php
- Raw: https://pluginprobe.com/plugins/s2member/110812/raw/includes/menu-pages/code-samples/specific-post-restrictions.php
- Modified: 2011-08-12T05:07:44+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/110812/code/includes/menu-pages/code-samples/specific-post-restrictions.php#L10-L20`.

```php
<?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". */
			}
	}
?>
```
