=== AddonLogic Members Only Content ===
Contributors: snehalpancholi
Tags: members only, restrict content, login, membership, content protection
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Restrict any section or entire post to logged-in users with a [members_only] shortcode and per-post meta box toggle.

== Description ==

**AddonLogic Members Only Content** gives you fine-grained control over which parts of your content are visible to guests versus members.

### Two ways to restrict content

**1. Shortcode — inline sections**

Wrap any paragraph, image, download link, or block of text with `[members_only]...[/members_only]`. Logged-in users see the content; guests see a configurable restriction message with a login link.

**2. Per-post toggle — entire post**

Each post and page gets a "Members Only Content" sidebar panel in the editor. Tick the checkbox to hide the entire post body from guests, optionally with a per-post custom message.

### Global Settings (Settings → Members Only)

* Default restriction message with basic HTML support
* Login link button text
* Choose: show a message *or* redirect guests straight to the login page
* Optional post-login redirect URL
* Control which post types show the meta box

### Performance & Security

* Content is restricted server-side — nothing is hidden with CSS that could be scraped
* All inputs sanitized with WordPress native functions
* Nonce-protected meta box saving
* Assets loaded only on the front end
* No external dependencies, no jQuery

== Installation ==

1. Upload the `members-only-content` folder to `/wp-content/plugins/`.
2. Activate the plugin through **Plugins → Installed Plugins**.
3. Go to **Settings → Members Only** to configure the default message and behaviour.
4. Add `[members_only]...[/members_only]` in any post or page, **or** tick the checkbox in the post editor sidebar.

== Frequently Asked Questions ==

= Does this work with Gutenberg? =
Yes. The meta box appears in the Block Editor sidebar under "Members Only Content".

= Can I show different messages for different sections? =
Yes. Use the `message` attribute: `[members_only message="Subscribe to read more."]...[/members_only]`

= What happens to SEO? =
Restricted content is not rendered in the HTML for guests, so search engines do not index it. Use this plugin intentionally for gated premium content.

= Can I use HTML in the restriction message? =
Yes — the default message and per-post custom message both accept basic HTML (links, bold, italic, line breaks) via `wp_kses_post()`.

= Does it work with custom post types? =
Yes. Any public post type registered on your site can be added to the meta box list in Settings → Members Only.

== Screenshots ==

1. Front-end restriction message shown to guests.
2. Per-post meta box in the block editor sidebar.
3. Settings page under Settings → Members Only.

== Changelog ==

= 1.0.0 =
* Initial release.
* [members_only] shortcode with message, login_url, and show_login_link attributes.
* Per-post meta box restriction with custom message support.
* Settings page: default message, login link text, redirect mode, post types.
* Server-side content restriction — no CSS tricks.
* Dark-mode compatible front-end styles.
* WordPress.org false-update prevention.
* AddonLogic update server integration.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
