=== IndieMan Custom Blocks ===
Contributors: indiemansoft
Donate link: https://ko-fi.com/indiemansoft
Tags: shortcodes, blocks, custom blocks, html, templates
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create reusable HTML components and shortcode templates with dynamic placeholder parameters and wrapper control.

== Description ==

**IndieMan Custom Blocks** lets you create reusable custom HTML components and template blocks and call them anywhere using clean shortcodes. Build banners, callout boxes, promo cards, alert notices, and layout modules once, then reuse them across your posts, pages, and widgets with dynamic attributes.

### Key Features:
* **Reusable Component Templates:** Design HTML component snippets once in a centralized admin interface and reuse them site-wide.
* **Dynamic Shortcode Placeholders:** Pass custom attributes directly in your shortcode (e.g. `[indieman_block id="1" title="Special Offer" btn_text="Buy Now"]`) and dynamically inject them using `{title}` and `{btn_text}` placeholders.
* **Enclosed Content Support:** Use the `{content}` placeholder to render content wrapped between opening and closing shortcode tags (`[indieman_block id="1"]Your custom text here[/indieman_block]`).
* **Built-in System Placeholders:** Automatically insert system values using `{site_url}`, `{site_title}`, `{current_year}`, `{post_title}`, and `{post_url}` in your templates.
* **Semantic Slug Shortcodes:** Set friendly custom slugs for your components to use semantic shortcodes like `[indieman_block slug="pricing_card"]` instead of numeric IDs.
* **Configurable Wrapper Element:** Choose your container HTML element (`<div>`, `<section>`, `<article>`, `<aside>`, or Raw HTML with no wrapper).
* **Native CodeMirror Editor:** Syntax-highlighted HTML editing with integrated 1-click clipboard copy buttons for shortcodes.
* **Secure & Standards Compliant:** Safe placeholder substitution sanitized via `wp_kses_post()`. No `eval()`, no arbitrary script execution, and fully WordPress.org compliant.

== Installation ==

1. Upload the `indieman-custom-blocks` folder to `/wp-content/plugins/`, or upload the zip archive via **Plugins -> Add New -> Upload Plugin**.
2. Activate the plugin in WordPress.
3. Open the **IndieMan Blocks** menu in your WordPress dashboard.
4. Click **Add New Block**, write your HTML template with dynamic `{placeholders}`, and publish.
5. Copy the generated shortcode and paste it into any post, page, or widget!

== Frequently Asked Questions ==

= What placeholder tags can I use in my templates? =
You can use two types of placeholders:
1. **Built-in System Tags (Auto-filled):**
* `{current_year}` — Current year (e.g., 2026).
* `{site_title}` — Website title from WordPress settings.
* `{site_url}` — Homepage URL.
* `{post_title}` — Title of the post or page where the block is displayed.
* `{post_url}` — Permalink of the current post or page.
* `{content}` — Content enclosed between opening and closing shortcode tags: `[indieman_block]Your text here[/indieman_block]`.

2. **Custom Shortcode Attributes (Unlimited):**
You can invent **any custom tag** simply by typing `{your_tag}` in your HTML template! Then in your shortcode, pass it as a matching attribute:
e.g., `[indieman_block id="1" price="$49" discount="50%" badge="SALE"]`.

= How do dynamic shortcode attributes work? =
Any custom attribute you add to the shortcode is matched to a `{attribute_name}` placeholder in your template. For example, if your template contains `<h3 style="color:#0073aa;">{title}</h3>`, using `[indieman_block id="1" title="Hello World"]` will replace `{title}` with "Hello World".

= Can I use nested shortcodes inside my custom blocks? =
Yes! Nested shortcodes are fully supported and safely parsed via WordPress `do_shortcode()`.

= Can I use this without a wrapping container tag? =
Yes. In the Shortcode Settings sidebar, set the **Block Wrapper Tag** to **No Wrapper (Raw HTML)**.

= Is this plugin safe and secure? =
Yes. Output is safely sanitized using standard WordPress functions (`wp_kses_post()`), and all attribute placeholders are escaped before rendering.

== Screenshots ==

1. HTML Template Editor with dynamic parameter hints and example code.
2. Shortcode settings with 1-click clipboard copy and custom slug configuration.
3. Blocks list table with quick shortcode copy buttons.

== Changelog ==

= 1.0.0 =
* Initial public release by IndieMan (wp.indieman.com.ua).
* Fast, lightweight HTML component and shortcode templating engine.
* Fully compliant with WordPress.org security, i18n, and capability standards.
