=== ACF Flexible Layout Preview ===
Contributors: chintan95
Tags: acf, flexible-content, layout-preview, admin, gutenberg
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: advanced-custom-fields-pro
Stable tag: 1.0.1
License: GPL-2.0-or-later

Manage preview images for ACF Flexible Content layouts from WordPress admin.

== Description ==

ACF Flexible Layout Preview adds a visual preview workflow for Advanced Custom Fields Flexible Content layouts. Editors can see layout screenshots before adding a row, and administrators can manage those images from a dedicated settings screen.

== Requirements ==

* Advanced Custom Fields Pro must be installed and active.
* A valid ACF Pro license key must be entered at ACF → Updates.

The plugin will not activate — and will deactivate itself at runtime — if either of these conditions is not met.

== Features ==

* Visual layout picker for ACF Flexible Content fields.
* Settings page under ACF > Layout Previews.
* Auto-discovers Flexible Content layouts from ACF field groups.
* Upload, replace, view, and remove layout preview images.
* Add custom layouts before they exist in an ACF field group.
* Default preview image for layouts without a custom preview.
* Grid column setting for the preview library.
* Light and dark settings page theme.
* Documentation tab with setup steps and usage benefits.
* Images stored in /wp-content/uploads/acf-layout-previews/.

== Installation ==

1. Upload the acf-flexible-layout-preview folder to /wp-content/plugins/.
2. Make sure Advanced Custom Fields Pro is installed, active, and licensed.
3. Activate ACF Flexible Layout Preview from Plugins > Installed Plugins.
4. Go to ACF > Layout Previews.
5. Upload preview images for your Flexible Content layouts.
6. Optional: open Display Settings to set a default preview image, popup grid columns, and popup light/dark theme.

== Frequently Asked Questions ==

= Do I need ACF Pro? =

Yes, this plugin requires Advanced Custom Fields Pro to be installed and active. The free version of ACF does not include Flexible Content fields.

= Where are preview images stored? =

Images are stored in /wp-content/uploads/acf-layout-previews/ to keep them separate from your media library.

= Can I use this with existing layouts? =

Yes! The plugin automatically discovers all existing Flexible Content layouts from your ACF field groups.

== Screenshots ==

1. The settings page showing the preview library grid.
2. The visual layout picker modal when adding a new layout.
3. Upload interface for managing preview images.

== Usage ==

1. Create an ACF Flexible Content field and add layouts.
2. Open the plugin settings page.
3. Upload a preview image for each discovered layout.
4. Use Add Custom Layout for layouts that are planned but not yet registered in ACF.
5. Edit a post, click Add Row/Add Layout, and choose layouts from the visual preview modal.

== Changelog ==

= 1.0.1 =
* Initial release.
* Consistent text domain acf-flexible-layout-preview throughout.
* All constants prefixed ACF_FLP_, all functions prefixed acf_flp_.
* JS global renamed from acflpData / acflpMap to acfFlpData / acfFlpMap.
* All admin page slugs and AJAX actions updated to match plugin slug.

== Upgrade Notice ==

= 1.0.1 =
Initial release. Requires ACF Pro.

== Author ==

Chintan Soni