=== OmniFields – Custom Fields & Options Manager ===
Contributors: viveksoni
Donate link: 
Tags: custom fields, omnifields, repeater, meta box, options page
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight custom field manager with visual field groups, advanced ACF-style location rules, options pages, repeaters, media and galleries.

== Description ==

**OmniFields – Custom Fields & Options Manager** is a modern, lightweight, and powerful custom fields solution for WordPress developers and site creators. Built from the ground up for speed, clean UX, and intuitive templating, it lets you add rich structured data to any post, page, custom post type, or global options page.

### 🌟 Key Features

1. **Advanced ACF-Style Location Rules**:
   * Target entire Post Types or Specific Individual Pages (e.g., "Academics", "Home", "About Us").
   * Target Specific Posts, Post Categories, or Post Statuses.
   * Target Page Templates (Default Template, custom theme templates).
   * Target Page Types (Front Page, Posts Page, Top Level Page, Parent Page, Child Page).
   * Target Current User Roles (Administrator, Editor, Author, etc.).
   * Target Options Pages & Sub-pages.
   * Powerful conditional logic: "and" (within same group) and "or" (between rule groups).

2. **Visual Field Group Builder**:
   * Create custom field groups with live label sync, drag-and-drop sorting, and field duplication.
   * 18 rich field types supported.

3. **Options Pages & Sub-pages System**:
   * Create top-level Options Pages in the WordPress sidebar (e.g. Theme Settings).
   * Create Sub-pages under any parent Options Page (e.g. Header, Footer, Social Media).
   * Custom Dashicon icons, menu slugs, and menu positions.

4. **18 Supported Field Types**:
   * Text, Textarea, Number, Email, URL, Password
   * Date, Time, Date & Time
   * Select (Dropdown), Radio buttons, Checkboxes
   * Image (with dropzone & live thumbnail preview)
   * Gallery (multi-image selector, thumbnail preview grid, remove icons, and drag-and-drop sortable)
   * File (with dropzone & file card preview)
   * Color picker
   * WYSIWYG Editor
   * Repeater (repeatable rows with sub-fields, drag-and-drop sorting)

5. **Intuitive PHP Template Functions**:
   * Easy-to-use template functions: `omni_get_field()`, `omni_the_field()`, `omni_get_option()`, `omni_get_image()`, `omni_get_gallery()`, `omni_get_repeater()`, `omni_have_rows()`, `omni_the_row()`, `omni_get_sub_field()`.

== Installation ==

1. Upload the `omnifields` folder to your `/wp-content/plugins/` directory, or install the ZIP directly via **Plugins > Add New > Upload Plugin**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **OmniFields** (or **Custom Fields**) in your WordPress admin sidebar.
4. Create your first Field Group or Options Page!

== Frequently Asked Questions ==

= How do I display a field value in my theme template? =
Use `omni_the_field('field_name')` to print it directly, or `$value = omni_get_field('field_name')` to retrieve the value.

= How do I get fields from an Options Page? =
You can use `omni_get_option('field_name')` or pass `'option'` as the second argument: `omni_get_field('field_name', 'option')`.

= How do Repeater fields work? =
You can iterate through repeaters using simple array syntax with `omni_get_repeater('my_repeater')` or using the loop syntax:
`if (omni_have_rows('my_repeater')) { while (omni_have_rows('my_repeater')) { omni_the_row(); echo esc_html(omni_get_sub_field('sub_title')); } }`

= Is this plugin compatible with the block editor and classic editor? =
Yes! OmniFields integrates seamlessly with both Gutenberg and Classic Editor.

== Screenshots ==

1. Visual Field Group Builder with drag-and-drop sorting.
2. Advanced ACF-style conditional location rules.
3. Options Pages & Sub-pages manager.
4. Post edit screen with media uploaders, galleries, and repeater fields.

== Changelog ==

= 1.0.0 =
* Initial public release of OmniFields.
* Added 18 field types including Repeater, Gallery, and Media dropzones.
* Added Advanced Location Rules engine.
* Added global Options Pages & Sub-pages system.

== Upgrade Notice ==

= 1.0.0 =
Initial release of OmniFields.
