=== Snap Blocks ===
Contributors: devnethr, MarinMatosevic
Tags: elementor, template, content blocks, repeatable content, layout
Requires PHP: 7.4
Stable tag: 1.2.0
Tested up to: 6.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Create and manage repeatable content blocks with Elementor or WPBakery. Insert them via shortcode or widget. Flexible and easy to use.

== Description ==

**Snap Blocks** is a lightweight plugin that lets you create reusable content blocks in WordPress.

Each block is its own post and can be edited with the free version of **Elementor**, or now also with **WPBakery Page Builder**. You can group them, duplicate them, and insert them anywhere using a shortcode or a built-in widget.

If you're familiar with reusable blocks in the Gutenberg editor, this works in a similar way — but built for popular page builders.

🛠️ Built for developers, designers, and content editors who want a smarter way to manage repeatable content across their WordPress sites.

### [DOCUMENTATION](https://devnet.hr/docs/snap-blocks/) | [SNAP BLOCKS PRO](https://devnet.hr/plugins/snap-blocks/)

== Features ==

- Custom post type: `snap_block` for managing standalone content blocks
- Edit blocks with **Elementor** or **WPBakery**
- Insert blocks via **shortcode**, Elementor widget, or WPBakery element
- Widgets include a dropdown selector for easy block selection
- Group taxonomy for better organization
- Duplicate blocks with one click
- Lightweight and clean admin UI
- No performance overhead

== PRO Features ==

With [Snap Blocks PRO](https://devnet.hr/plugins/snap-blocks/), you unlock automatic block insertion, advanced display conditions, precise hook placement control, and full compatibility with WooCommerce and core WordPress contexts.

- Automatic block insertion (no shortcode needed)
- Hook position selector (WooCommerce & WordPress hooks)
- Display blocks based on context:
  - WooCommerce
    - Single Product
    - Product Archive
    - Cart
    - Checkout
    - Thank You page
    - My Account
  - WordPress
    - Single Post
    - Page
    - Post Archive
- Advanced conditions:
  - Specific products
  - Categories
  - Tags
  - Pages
  - Posts
- Multiple conditions support
- Custom hook name option
- Priority control for precise placement
- Developer-friendly architecture


== Getting Started with Snap Blocks ==

### ✅ 1. Enable Page Builder for Snap Blocks

#### Elementor

- Go to **Elementor → Settings → General**
- Check **Snap Blocks** under “Post Types”

#### WPBakery

- Go to **WPBakery Page Builder → Role Manager**
- From the **Post Types** dropdown, select **Custom**
- Enable the **Snap Blocks** post type for relevant user roles
- Click **Save Changes**

### ➕ 2. Create a Snap Block

- Go to **Snap Blocks → Add New**
- Use **Elementor** or **WPBakery** to build the block content
- Assign a **Group** if needed for better organization

### 🧩 3. Insert via Elementor or WPBakery Widget

- Edit any page or template with **Elementor** or **WPBakery**
- Look for the **Snap Block** widget/element
- Select a block from the dropdown menu

### 🔤 4. (Alternatively) Insert via Shortcode

Paste the following shortcode anywhere: `[snap_block id="123"]`

Replace `123` with the block’s ID.


## Early Development Notice

**Snap Blocks** is in the early stages of development, and we're actively working to expand its features. Future updates will include support for additional features and deeper integrations.

Your feedback is invaluable! If you have specific needs or suggestions, please share them in the support forum. We appreciate your support and look forward to improving Snap Blocks with your input.

## Other Plugins by Devnet

Here are some other plugins we have developed that you might find useful:

- [Free Shipping Label](https://wordpress.org/plugins/snap-blocks/) - Increase order revenue by showing your customers just how close they are to your free shipping threshold.
    - [FSL Discount Add-On](https://devnet.hr/plugins/snap-blocks/#fsl-discount) - By setting customizable thresholds for single, double, or triple-step discounts, you’ll motivate shoppers to add more to their carts.
- [Product Price History](https://wordpress.org/plugins/product-price-history/) - Track product price history with customizable charts and graphs on your WooCommerce store. Show lowest price and increase customer trust.
- [Easy Subscribe](https://wordpress.org/plugins/easy-subscribe/) - Effortlessly integrate customizable subscription forms on your WordPress site with a simple shortcode.
    - [Easy Subscribe – WooCommerce Add-On](https://devnet.hr/plugins/easy-subscribe/#woocommerce-add-on) lets you place a subscription form directly on product pages to capture leads at the moment of interest and grow targeted subscriber lists based on customer preferences.
- [Easy Booking Calendar](https://wordpress.org/plugins/easy-booking-calendar/) - Turn any product into a reservation-ready item. This plugin adds a customizable calendar to product pages, allowing customers to select date ranges for bookings.
- [BizNotes](https://wordpress.org/plugins/biznotes/) - Exclusive admin notes for seamless order management among multiple admins. Effortless collaboration, powered up.
- [Snap Blocks](https://wordpress.org/plugins/snap-blocks/) - A lightweight plugin that lets you create reusable content blocks in WordPress.
- [PingVid](https://wordpress.org/plugins/pingvid/) - A lightweight WordPress plugin that adds a floating video widget to your site.


== Installation ==

This plugin can be easily installed like any other WordPress integration by following the steps below:

1. Upload the plugin to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to the page: Snap Blocks
4. Start adding and designing your content blocks.


== Frequently Asked Questions ==

= Do I need Elementor Pro? =

Nope! The plugin works with the free version of Elementor.

= Can I use these blocks in WPBakery? =

Yes! Each Snap Block can be edited using WPBakery Page Builder and inserted via the Snap Block element.

= Can I use these blocks in non-builder content? =

Yes. Just use the `[snap_block id="123"]` shortcode wherever shortcodes are supported.

= What happens if I delete a block? =

The shortcode/widget will display nothing if the block is deleted or unpublished.

= Is this plugin performance-heavy? =

Not at all. It’s lightweight and uses core WordPress, Elementor, and WPBakery functionality under the hood.

= How can I duplicate a block? =

Use the **Duplicate** link under any block in the admin listing to quickly create a copy.



== Changelog ==

= 1.2.0 = 

*2026-02-13*

* Fix: Resolved edge case where shortcode rendered empty wrapper
* Fix: Minor admin UI styling inconsistencies
* Update: Freemius SDK updated to the latest version
* Improvement: Optimized block rendering performance
* UI: New centralized conditions modal interface


= 1.1.2 = 

*2025-12-12*

* Fix: Resolved edge-case error when opening blocks in Elementor
* Fix: Plugin icon not visible in WPBakery
* Update: Freemius SDK updated to the latest version
* Compatibility: WP tested up to 6.9

= 1.1.1 = 

*2025-10-10*

* Fix: Freemius integration


= 1.1.0 = 

*2025-10-06*

* Add: Freemius integration
* Performance: Code optimizations for better plugin efficiency
* Compatibility: WP tested up to 6.8


= 1.0.1 = 

*2025-05-09*

* Add: WPBakery Integration

= 1.0.0 = 

*2025-05-08*

* Initial release.
