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

Build custom field groups with a modern admin UI. Repeaters, galleries, relationships, conditional logic, and template helpers.

== Description ==

Massoftind Field Builder lets you create reusable field groups and show them on posts, pages, and custom post types — without writing boilerplate meta box code for every project.

Use the visual builder to add fields, set location rules, and configure presentation. Values are stored as post meta and can be rendered in themes with safe PHP helpers.

= What you can build =

* Text, number, email, URL, date, time, color, and range fields
* Media: image, gallery, file, YouTube video
* Rich content: WYSIWYG, code editor, shortcode
* Choices: select, checkbox, radio, toggle, star rating
* Relations: post object, relationship, taxonomy, user
* Layout: repeater, group, accordion, tabs

= Useful features =

* Drag-and-drop field builder with search and duplication
* Location rules (post type, template, taxonomy, and more)
* Conditional logic (show/hide fields)
* Import and export field groups as JSON
* Developer panel with copy-ready template examples
* Optional authenticated REST API for field groups and values
* Built-in documentation in wp-admin
* qTranslate-X / qTranslate-XT: Language Switching Buttons on text fields; front-end helpers return the active language

= Template helpers =

Use functions such as `massoftind_fb_get()`, `massoftind_fb_field()`, `massoftind_fb_have_rows()`, `massoftind_fb_image()`, and `massoftind_fb_the_gallery()` in theme templates. See the in-plugin documentation for full examples.

= Third-party services =

When a YouTube field is used, the admin and front end may load thumbnails or embeds from YouTube (googlevideo.com / i.ytimg.com). Those requests go to Google/YouTube only when such media is configured. Review [YouTube Terms of Service](https://www.youtube.com/t/terms) if you publish that content.

SVG file uploads are disabled by default. Sites that need SVG media can enable them with the `massoftind_fb_allow_svg_uploads` filter.

= Optional integration =

Works alongside **Dynamic Content Builder** for front-end listings driven by custom fields. Compatible with **qTranslate-X** / **qTranslate-XT** for multilingual field values. No other plugins are required.

== Installation ==

1. Upload the `massoftind-field-builder` folder to `/wp-content/plugins/`, or install the zip 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 in your theme.

== Frequently Asked Questions ==

= Do I need Advanced Custom Fields? =

No. This plugin is a standalone custom fields builder.

= Where are field values stored? =

As prefixed post meta on the content object. Field-group definitions are stored as an internal custom post type.

= Can I move field groups between sites? =

Yes. Use **Tools → Export** and **Import** to transfer JSON field-group definitions.

= Is there a REST API? =

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

= Does this phone home? =

No. The plugin does not send your site data to Massoftind.

= Does it work with qTranslate-X? =

Yes. With **qTranslate-X** or **qTranslate-XT** active, text-like fields (text, textarea, WYSIWYG, email, URL, shortcode, code editor, link title) use Language Switching Buttons in the editor. Template helpers such as `massoftind_fb_get()` return the value for the current language on the front end. Values are stored with qTranslate `[:lang]` tags.

== Screenshots ==

1. Field group list
2. Visual field builder
3. Location rules
4. Conditional logic
5. Developer panel with template snippets

== Changelog ==

= 1.3.58 =
* Fix: qTranslate-X compatibility — read raw Field Builder meta then translate strings so repeater have_rows()/sub_field() work on the front end.

= 1.3.57 =
* Fix: lock main page ID before get_header so repeater helpers read the correct post meta.
* Fix: empty key-based meta arrays no longer block fallback to name-based stored values.

= 1.3.56 =
* Fix: template helpers prefer the queried page ID on singular views so values still load after get_header() / secondary loops.

= 1.3.55 =
* Fix: have_rows() on Group fields no longer drops text sub-fields (badge/heading empty while loop still ran).

= 1.3.54 =
* Fix: nested Sub Fields drag-and-drop blocked by sortable cancel matching parent inline config panels.

= 1.3.53 =
* UI: remove help “i” icons next to Label / Name and other setting labels.

= 1.3.52 =
* Fix: builder tooltips clipped by overflow — Delete/Drag tips now show.
* Fix: drag-reorder for deeply nested Sub Fields (Repeater → Group → Repeater → fields).

= 1.3.51 =
* Fix: text domain aligned to plugin slug massoftind-field-builder.
* Security: sanitize posted field trees and AJAX JSON payloads before use.
* Fix: remove standalone wp_enqueue_script(wplink); load via script dependencies (core handle).

= 1.3.50 =
* Fix: SVG image/gallery admin preview blank after save (inlined SVG was stripped by wp_kses_post; use img preview instead).

= 1.3.49 =
* Fix: harden sanitize for checkbox, image, file, gallery, relationship, range, video, and YouTube against array POST / "Array" corruption.
* Fix: re-sync qTranslate hooks after AJAX-added repeater, accordion, and tabs rows.

= 1.3.48 =
* Fix: repeater delete + qTranslate — rebind hidden language field names after reindex so removed rows stay removed.
* Fix: scalar fields no longer save PHP "(string) array" as the literal text "Array".
* Fix: drop empty/corrupt repeater rows (junk nested rows created by stale multilingual POST data).

= 1.3.47 =
* Plugin Check: echo SVG/video HTML via wp_kses() directly (custom kses wrappers are not recognized by PHPCS).

= 1.3.46 =
* Security: tighten REST permission callbacks (manage_options for field groups; edit_post for per-post field values).
* I18n: text domain aligned to WordPress.org slug `massoftind-field-builder`.
* Security: late-escape admin/field output (attributes, SVG, shortcodes, media previews) via esc_attr / wp_kses / wp_kses_post.
* Prefixing: remove generic DFB_* global constants; keep massoftind_fb / MASSOFTIND_FB prefixes.

= 1.3.45 =
* Fix: when two field groups use the same field name, helpers pick the field that has stored values (not the empty duplicate).

= 1.3.44 =
* Native qTranslate-X / qTranslate-XT support: admin Language Switching Buttons and front-end language decode for template helpers.

= 1.3.43 =
* Rebranded to Massoftind Field Builder (slug, text domain, namespace, prefixes).
* Removed non-GPL Fancybox; gallery lightbox is plugin GPL JS. Masonry uses WordPress core only.
* Assets load via wp_enqueue_* / wp_add_inline_*; no inline style/script tags in templates.
* WordPress.org submission polish: remove trademark tag; defer plugin details to the official directory API.

= 1.3.42 =
* Plugin Check: replace var_export in developer code generator; document intentional meta_key ordering query.

= 1.3.41 =
* Plugin Check fixes: translators comments, local asset loading (no CDN), wp_enqueue_style for details modal.

= 1.3.40 =
* WordPress.org packaging: readme.txt, license.txt, Plugin Check cleanup, author/branding alignment.

= 1.3.39 =
* Developer Panel: Full Template Example for Repeaters/Groups includes Conditional Logic as PHP `if` checks.

= 1.3.38 =
* Fixed Conditional Logic dropdown changes triggering a full panel rebuild on autosave.

= 1.3.37 =
* Date field: Display Format and Return Format settings; `massoftind_fb_date()` / `massoftind_fb_the_date()` helpers.

== Upgrade Notice ==

= 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.
