== AddonLogic Event Capacity Limits ==

Contributors: snehalpancholi
Tags: events, capacity, rsvp, sold-out, registration
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cap registrations or RSVPs per event post and display remaining spots or sold-out status via a shortcode or auto-injected badge.

== Description ==

AddonLogic Event Capacity Limits gives you complete control over how many people can register for any event, post, or custom post type on your WordPress site.

**Key Features:**

* Works with any public post type — including the AddonLogic Simple Event Calendar `sec_event` CPT
* Per-post capacity meta box with max capacity, current count, and custom sold-out text
* AJAX-powered +/- buttons for quick admin count adjustments without saving the post
* Auto-inject sold-out or remaining-spots badge into post content (no shortcode needed)
* `[event_capacity]` shortcode with full attribute control
* Public AJAX endpoint (`addlc_ecl_register`) for frontend registration integration
* Fires `addlc_ecl_after_register` action hook for custom workflows
* Clean uninstall — removes all meta and options

== Installation ==

1. Upload the `event-capacity-limits` folder to `/wp-content/plugins/`.
2. Activate through **Plugins > Installed Plugins**.
3. Go to **Settings > Event Capacity** to configure which post types and badge behaviour to use.
4. Edit any enabled post type and set capacity in the **Event Capacity** meta box.

== Frequently Asked Questions ==

= Which post types are supported? =

All public post types. By default, `sec_event` (from AddonLogic Simple Event Calendar) and `post` are enabled. You can add any CPT in Settings > Event Capacity.

= Can I integrate this with a custom registration form? =

Yes. Send a POST request to `admin-ajax.php` with `action=addlc_ecl_register`, `post_id=<ID>`, and a nonce for `addlc_ecl_register_{post_id}`. The plugin returns JSON and fires the `addlc_ecl_after_register` action.

= What happens if I set max capacity to 0? =

A max capacity of 0 means unlimited. The shortcode shows "Available" and no sold-out badge is ever injected.

= Can I override the sold-out text per post? =

Yes. The **Sold Out Text** field in the meta box overrides the site default for that specific post only.

= Does it work with page builders? =

The shortcode works anywhere shortcodes are supported. The auto-inject uses the `the_content` filter, which most builders respect on the frontend.

== Screenshots ==

1. Event Capacity meta box on a post edit screen with +/- counter buttons and live status badge.
2. Settings page showing post type checkboxes, sold-out text, and auto-inject options.
3. Frontend sold-out badge auto-injected above post content.
4. Frontend remaining-spots notice rendered via shortcode.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
