=== Massoftind Field Builder ===
Contributors: masssoftware, devmanishpathak, sandipbiswas123, massoft
Donate link: https://masssoftwaresolutions.com/
Tags: custom fields, field builder, repeater, metabox, gallery
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.9.156
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Modern custom fields for WordPress — visual builder, nested repeaters, galleries, relationships, WPML, conditional logic, and theme helpers.

== Description ==

**Massoftind Field Builder** is a modern custom-fields / field-builder plugin for WordPress. Build reusable field groups with a clean visual UI, nest repeaters and layout blocks, attach media and relationships, and render values safely in your theme.

= Highlights =

* **Visual field builder** — drag-and-drop fields, search, duplicate, Browse Fields type switcher
* **37 field types** — text, media, choices, relations, layout, and more
* **Nested structures** — Repeater, Group, Accordion, Tabs, Layout Blocks
* **Smart location rules** — post type, template, taxonomy, user form, and custom filters
* **Conditional logic** — show/hide fields based on other field values
* **Developer-first** — copy-ready PHP snippets, Filters & Hooks guide, optional REST API
* **Bricks Builder** — `{mfb_field}` Dynamic Data tags + Massoftind Repeater query loop (coexists with ACF Pro `{acf_…}`)
* **Elementor** — Massoftind Dynamic Tags (text, image, URL, gallery, color, number) for CMS page building without ACF
* **Multilingual-ready** — WPML / WCML and qTranslate-X / qTranslate-XT
* **Try instantly** — [WordPress Playground live demo](https://playground.wordpress.net/?plugin=massoftind-field-builder&url=/wp-admin/admin.php%3Fpage%3Dmassoftind-fb-field-groups&php=8.2)

= Try a live demo =

Open WordPress Playground with the plugin preinstalled:

[Try Massoftind Field Builder in WordPress Playground](https://playground.wordpress.net/?plugin=massoftind-field-builder&url=/wp-admin/admin.php%3Fpage%3Dmassoftind-fb-field-groups&php=8.2)

= Video walkthrough =

https://www.youtube.com/watch?v=6Z7VDzOmx1M

= Field types =

* **Basic:** Text, Textarea, Number, Email, URL, Password, Hidden, Range, Color
* **Content:** WYSIWYG, Code Editor, Shortcode, Link, Message (instructions only)
* **Date & time:** Date, Date & Time, Time
* **Media:** Image, Gallery, File, Video, YouTube
* **Choices:** Select, Checkbox, Radio, Toggle, Star Rating
* **Relations:** Post Object, Relationship, Taxonomy, User
* **Layout:** Repeater, Group, Accordion, Tabs, Layout Blocks, Clone

= Modern media & gallery =

* Gallery and Image return formats: Image ID, Image URL, or **Image Array**
* Gallery layouts: Card / Masonry with optional lightbox
* Per-image **Link URL** + **Link Target** (`_blank`, `_self`, `_parent`, `_top`) in the Media sidebar
* Theme loops can use `$img['external_url']` and `$img['target']` (or `massoftind_fb_the_gallery()`)

= Relationships & taxonomies =

* Relationship dual-list picker with search, filters, drag reorder
* **Allow Multiple** with optional **Min / Max** selection limits
* WPML-aware titles — Available and Selected stay in the current admin language
* Taxonomy multi-select preserves pick order; optional **Exclude Terms** picker
* Taxonomy **Min / Max** when multiple is enabled

= Builder & admin experience =

* Drag-and-drop field builder with nested Sub Fields
* Location rules (post type, page template, taxonomy, role, and more)
* Conditional logic on fields
* Import / export field groups as JSON
* Post Types, Taxonomies, Site Sections, List Views, and **Content Order**
* Settings: Preferences, Field Usage Guide, **Filters & Hooks** reference
* Optional Classic Editor toggle and SVG upload control
* Onboarding checklist and in-plugin documentation

= Multilingual & integrations =

* **qTranslate-X / qTranslate-XT** — language buttons on text-like fields
* **WPML + WooCommerce Multilingual** — translate/copy custom fields; product sync with WCML
* **Yoast SEO / Premium** and **Rank Math / Pro** — custom field variables
* **WooCommerce** location rules for products
* **WP All Import Pro** / **WP All Export Pro** field exposure
* **Elementor** (Free + Pro) — Massoftind Dynamic Tags group

= Template helpers =

Use in your theme:

* `massoftind_fb_get()` / `massoftind_fb_update()`
* `massoftind_fb_have_rows()` / `massoftind_fb_the_row()` / `massoftind_fb_sub_field()`
* `massoftind_fb_image()` / `massoftind_fb_gallery()` / `massoftind_fb_the_gallery()`
* `massoftind_fb_terms()` / `massoftind_fb_date()` and more

Optional template-compatibility aliases (`get_field`, `have_rows`, …) can be enabled in Settings for existing theme code.

= Bricks Builder =

When [Bricks](https://bricksbuilder.io/) is active (Settings → Bricks Dynamic Data on by default):

* Use `{mfb_field_name}` in Dynamic Data (group **Massoftind Field Builder**)
* Options: `{mfb_option:field_name}`
* Repeaters: Query Loop type **Massoftind Repeater**, set Meta Key to the repeater name, use `{mfb_row:sub_field}` inside the loop
* ACF Pro can stay installed — `{acf_…}` tags are not changed; rebind templates to `{mfb_…}` only when migrating fields
* **Or deactivate ACF:** with **Bricks ACF tag alias** (default on), existing `{acf_…}` tags and ACF repeater query loops are resolved by Massoftind — no Bricks template edits

= Elementor =

When [Elementor](https://elementor.com/) is active (Settings → Elementor Dynamic Tags on by default):

* Open any widget control that supports Dynamic Tags → group **Massoftind Field Builder**
* Tags: **Massoftind Field** (text), **Image**, **URL**, **Gallery**, **Color**, **Number**
* Source: **Current post / term** or **Site Sections / Options**
* Nested Group fields appear as `parent_child` names in the picker
* Prefer these tags for new CMS builds; optional ACF shim still helps some Elementor Pro ACF widgets after migration

= Privacy & third-party services =

* Does **not** phone home or send site data to Massoftind
* YouTube fields may load thumbnails/embeds from YouTube only when configured — see [YouTube Terms](https://www.youtube.com/t/terms)
* SVG uploads are **off by default** (Settings → Allow SVG Uploads)

= Optional companion =

Works alongside **Dynamic Content Builder** for front-end listings. No other plugins are required to use Field Builder.

== Installation ==

1. Upload the `massoftind-field-builder` folder to `/wp-content/plugins/`, or install via **Plugins → Add New → Upload Plugin**.
2. Activate **Massoftind Field Builder**.
3. Open **Field Builders** in the admin menu.
4. Create a field group, add fields, set location rules, and save.
5. Edit matching content and use template helpers (or the developer panel snippets) in your theme.

== Frequently Asked Questions ==

= Do I need another custom fields plugin? =

No. Massoftind Field Builder is a standalone field builder with its own metabox UI, repeaters, and template helpers.

= Can I try it before installing? =

Yes — [WordPress Playground live demo](https://playground.wordpress.net/?plugin=massoftind-field-builder&url=/wp-admin/admin.php%3Fpage%3Dmassoftind-fb-field-groups&php=8.2).

= Where are field values stored? =

As prefixed post meta. Field-group definitions use an internal custom post type.

= How do I set a Link URL on a gallery image? =

Open the Gallery field → **Edit** on a thumbnail → in Attachment Details set optional **Link URL** and **Link Target**. Values appear in Image Array as `external_url` and `target`.

= Can I limit how many items a Relationship or Taxonomy field allows? =

Yes. Enable **Allow Multiple**, then set optional **Minimum Selections** and **Maximum Selections** (0 = no limit).

= Can I move field groups between sites? =

Yes. Use **Tools → Export** and **Import** for JSON field-group definitions (and related Post Types / Taxonomies / Site Sections when present).

= Is there a REST API? =

Yes, optional. Enable under **Field Builders → Settings**. Endpoints require authenticated users with the right capabilities.

= Does this phone home? =

No.

= Does it work with qTranslate-X? =

Yes. With **qTranslate-X** or **qTranslate-XT**, text-like fields use Language Switching Buttons. Helpers return the active language on the front end.

= Does it work with Yoast SEO, Rank Math, WP All Import / Export? =

Yes, when those plugins are active (SEO variables, sitemap exclusions, import/export field exposure).

= Does it work with WPML / WooCommerce Multilingual? =

Yes. Fields register for translate/copy; WCML product translation UI is supported. Override under WPML → Settings → Custom Fields Translation.

= Does it work with Bricks Builder and ACF Pro? =

Yes. Bricks Dynamic Data shows a **Massoftind Field Builder** group with `{mfb_field_name}` tags. While ACF Pro is active, Bricks’ `{acf_…}` tags stay native to ACF. After you deactivate ACF and import field JSON into Massoftind, enable **Settings → Bricks ACF tag alias** (default on) so the same `{acf_…}` tags and ACF repeater loops keep working through Massoftind — no Bricks template or core edits. For repeaters you can also use Query Loop type **Massoftind Repeater** and `{mfb_row:sub_field}`.

= Does it work with Elementor? =

Yes. With Elementor active, Dynamic Tags include a **Massoftind Field Builder** group (text, image, URL, gallery, color, number). Bind Heading, Image, Button, and Gallery widgets to your fields — including Site Sections / Options. Keep field names when migrating from ACF; use the Massoftind tags for a reliable CMS workflow (Elementor Pro’s ACF tags remain best-effort via the optional ACF shim).

== Screenshots ==

1. Simple & Intuitive — create field groups and edit values in a clean modern admin UI.
2. Made For Developers — template helpers and copy-ready snippets from the developer panel.
3. All About Fields — 37 field types: Text, WYSIWYG, Image, Gallery, Relationship, Repeater, Layout Blocks, and more.
4. Location Rules — show field groups by post type, template, taxonomy, role, and more.
5. Latest features — Image Edit/Remove overlays, Gallery Link URL + Target, Content Order, WPML-ready relationships, and WYSIWYG embeds.

== Changelog ==

= 1.9.156 =
* Fix: Gallery Logos UI — overlapping thumbs / stacked Edit× icons after reorder (jQuery UI Sortable + flex; also broken when gallery sits in a hidden meta tab).
* Fix: Gallery uses float layout, clears leftover absolute positioning, refreshes on meta-tab switch.
* Compat: Admin UI only — Bricks, Elementor, WPML, and qTranslate value/rendering paths unchanged.

= 1.9.155 =
* Fix: Gallery field — reordering images no longer leaves duplicate Edit/Remove icons; improved drag helper/placeholder.
* New: Repeater rows are drag-sortable via a grip handle (order saved on publish).
* Fix: Content Order — correct pagination offset when saving, more reliable sortable init, Quick Edit re-bind.
* Compat: Bricks, Elementor, WPML, and qTranslate paths unchanged.

= 1.9.154 =
* Fix: `get_field( $name, get_queried_object() )` / `massoftind_fb_get()` accept `WP_Term` objects (ACF parity) so taxonomy term banners and term meta render on archives.
* Compat: Bricks, Elementor, WPML, and qTranslate paths unchanged — term values still run through `massoftind_fb_format_value`.

= 1.9.153 =
* Fix: Menu SVG icons — convert theme `<img class="menu_svg_image" src="….svg">` to sanitized inline `<svg>` on the front end (no theme edit). Works even when Allow SVG Uploads is off.
* Note: Allow SVG Uploads remains upload-only. Front-end menu inlining is separate.

= 1.9.152 =
* Fix: `get_field( $name, $item )` / `massoftind_fb_get()` accept menu item objects (ACF parity) so Appearance → Menus fields like Menu SVG resolve on the front end.
* Fix: Template-compat post ID normalizer extracts `->ID` from objects instead of falling back to the current page.
* Fix: Image fields on `nav_menu_item` return a URL string (unless Return Format is Image Array) so existing `<img src="' . $icon . '">` theme filters work without edits.

= 1.9.151 =
* New: **Elementor Dynamic Tags** — Massoftind Field / Image / URL / Gallery / Color / Number group for CMS page building without ACF.
* New: Settings → **Elementor Dynamic Tags** (on by default); source Current post/term or Site Sections / Options.
* Compat: Bricks, WPML, and qTranslate paths unchanged.

= 1.9.150 =
* New: Location rule **Menu Item** (`nav_menu`) — attach fields to Appearance → Menus items (ACF-compatible, e.g. Menu SVG).
* New: ACF import maps `nav_menu` / `menu_item` / `nav_menu_item` location rules; values save as `nav_menu_item` post meta for `get_field( $name, $item_id )` (Elementor Pro, Bricks, themes).
* Compat: WPML menu-item duplicates disconnect on save; qTranslate still formats via existing `massoftind_fb_format_value` on get.

= 1.9.149 =
* Fix: Bricks loop `get_field()` values run through `massoftind_fb_format_value` again (qTranslate `[:lang]` decode).
* Fix: Stale Massoftind repeater context clears when Bricks starts a non-MFB query; container-root gating still blocks Our Story–style tag theft.
* Fix: Bricks text/link dynamic data applies the same format filter before shortcodes.

= 1.9.148 =
* Fix: Nested `have_rows( 'group_field' )` inside a repeater/group (e.g. `video_section` in `banner_section`) no longer drops associative group values — hero video loops work again.

= 1.9.147 =
* Fix: Bricks repeater loop tags like `{acf_item_repeater_item_heading}` render again (Mission / Why Live Local empty boxes).
* Fix: Loop-row resolution matches the active repeater path (not a shorter FieldCatalog root), and settings no longer wipe loop tags before the loop runs.
* Fix: `get_field()` reads the active Bricks Massoftind loop row so Bricks' native ACF provider gets sub-field values.

= 1.9.146 =
* Fix: `get_sub_field()` keeps numeric attachment IDs (instead of converting them to arrays) when the sub-field definition is missing, so `wp_get_attachment_image()` works with Image ID return format.
* Fix: Stronger repeater parent lookup when resolving nested image/file sub-fields.
* New: `massoftind_fb_attachment_image()` / `massoftind_fb_get_attachment_image()` helpers that render SVGs and other attachments that `wp_get_attachment_image()` skips.

= 1.9.145 =
* Fix: Bricks query loops no longer leave stale row context that steals later `{mfb_*}` / group field tags (e.g. Our Story after Mission/Vision).
* Fix: ACF Star Rating Field import type `star_rating_field` maps to native Star Rating so admin no longer shows "This field type is not available."
* Fix: Bricks dynamic data for `star_rating` fields outputs star HTML instead of a bare number.

= 1.9.144 =
* Fix: WordPress shortcodes in Text/Textarea fields (e.g. `[current_year]`) run through `do_shortcode()` when rendered in Bricks dynamic data and via `massoftind_fb_get()`.

= 1.9.143 =
* Fix: Bricks homepage/catalog sections empty when fields are on the front page but values live in Site Sections or legacy ACF Options keys — option fallback no longer blocked by front-page location rules.
* Fix: Resolve `{acf_*}` in Bricks Heading/Text/Link element settings before render (catalog + service sections).
* Fix: WPML-safe — post-only fields still never fall back to globals; legacy ACF option keys are detected before blocking.

= 1.9.142 =
* Fix: Bricks `{acf_*}` Site Section / global fields resolve when called without `:option` — `get_field()` and `get_field_object()` now fall back to wp_options (footer, homepage sections, contact info).
* Fix: Nested group sub-fields and underscore paths (`footer_connect_section_heading`) read from Site Section option storage.
* Fix: Option fallback is gated to Site Section fields only — post-assigned fields with empty meta stay empty (WPML per-translation). qTranslate still decodes via existing `massoftind_fb_format_value` on options.

= 1.9.141 =
* Fix: Bricks Logo/Image fatal (`preg_split(): array given`) — remove early `render_tag` hook at priority 5 that returned image arrays before Bricks' ACF provider runs.
* Fix: Resolve dynamic logo image fields via `filter_element_settings` on the Logo element.

= 1.9.140 =
* Fix: Bricks `{acf_*}` dynamic tags render again — keep Bricks' native ACF provider and resolve tags early via BricksSupport (1.9.139 had disabled the provider, leaving raw `{ACF_…}` in templates).
* Fix: Site Section / options fields (footer globals) resolve by full field path, not only the first underscore segment.


For earlier releases, see the `changelog.txt` file bundled with the plugin.

== Upgrade Notice ==

= 1.9.156 =
Fixes Gallery thumbnail/icon overlap after drag and inside meta tabs.

= 1.9.155 =
Fixes Gallery reorder icon glitches, adds Repeater row drag sorting, and hardens Content Order saving.

= 1.9.154 =
Fixes taxonomy term banners when themes call get_field( $name, get_queried_object() ) with a WP_Term.

= 1.9.153 =
Menu SVG icons render as inline SVG (theme img tags converted) without theme edits.

= 1.9.152 =
Fixes Menu SVG / menu-item fields for existing theme filters that call get_field( $name, $item ) and use the value as an image URL — no theme edits required.

= 1.9.151 =
Adds Elementor Dynamic Tags (Massoftind Field Builder group) for CMS page building without ACF.

= 1.9.150 =
Adds Menu Item location fields (Appearance → Menus) with ACF import compatibility.

= 1.9.149 =
Hardens Bricks loop context for WPML/qTranslate safety (format filters + stale loop clear).

= 1.9.148 =
Fixes nested have_rows() for Group fields inside repeaters (e.g. hero video_section).

= 1.9.147 =
Fixes empty Bricks repeater boxes (Mission / Why Live Local) when using {acf_repeater_subfield} tags.

= 1.9.146 =
Fixes get_sub_field() Image ID return for missing sub-field defs, and adds SVG-safe attachment image helpers.

= 1.9.145 =
Fixes Bricks stale loop context for group fields, ACF star_rating_field alias, and star HTML in Bricks DD.

= 1.9.143 =
Fixes empty Bricks catalog/service sections on homepage (legacy ACF options + Site Sections).

= 1.9.142 =
Fixes empty Bricks global fields (footer, homepage) when ACF Options Page fields are stored in Site Sections.

= 1.9.141 =
Urgent: fixes Bricks Logo/Image fatal on sites using 1.9.140.

= 1.9.140 =
Fix Bricks templates showing raw `{acf_*}` / `{ACF_*}` tags after 1.9.139.

= 1.9.139 =
Fix Bricks `{acf_*}` tags without breaking WPML or qTranslate — native Bricks ACF provider stays off when only the MFB shim exists; MFB BricksSupport handles dynamic data.

= 1.9.138 =
Fix empty repeater tabs (have_rows called for nav then content) and stop the ACF shim from activating qTranslate-X / ACFML as if real ACF were installed.

= 1.9.137 =
Fix qTranslate-X fatal `acf_get_field_type()` missing from the ACF compatibility shim.

= 1.9.136 =
Fix WP All Import ACF Add-On crash after each record (`acf_save_post_revision` missing from the ACF shim).

= 1.9.135 =
Fix WP All Import ACF Add-On activation output by loading the ACF compatibility shim earlier.

= 1.9.134 =
ACF/WPML compatibility: WP All Import ACF Add-On support without ACF installed; WPML JSON config fix.

= 1.9.133 =
Plugin Check fixes: Google Maps script versioning and Stable tag alignment. Includes Google Map field from 1.9.132.

= 1.9.73 =
Image fields use compact Edit / Remove overlays on the thumbnail.

= 1.9.72 =
WYSIWYG [embed] / YouTube videos now render on the front end.

= 1.9.71 =
Critical: restores Product/Blog category lists emptied by Content Order + WPML conflict.

= 1.9.70 =
Product category Content Order now persists after refresh (syncs WooCommerce order meta).

= 1.9.68 =
Taxonomy multi-select tags can be drag-reordered (Select Popular Categories order is saved).

= 1.9.67 =
Content Order saves Product categories again; shipping/other admin notices hidden on Field Builder pages.

= 1.9.66 =
Richer WordPress.org Details page — modern feature list (gallery links, min/max, WPML, integrations).

= 1.9.5 =
Stable tag aligned with plugin version; gallery Image Array return format; video walkthrough link.

= 1.6.0 =
Adds Layout Blocks for composable page sections, portable flexible-layout JSON import, and get_row_layout() compatibility.

= 1.5.0 =
Adds migration helpers: legacy meta read fallback, Tools migration, and Settings toggles for template compatibility.

= 1.3.44 =
Adds native qTranslate-X / qTranslate-XT support for multilingual field values.

= 1.3.43 =
WordPress.org-first packaging: safer readme tags and official plugin information flow.

= 1.3.42 =
Plugin Check warning fixes for developer code generation and field group ordering.

= 1.3.41 =
Plugin Check error fixes; gallery libraries bundled locally.

= 1.3.40 =
WordPress.org submission package; requires WordPress 6.2+.

= 1.3.39 =
Developer Panel conditional-logic template examples for nested fields.

