=== Plinth Custom Fields ===
Contributors: shobhitverma
Tags: custom fields, field groups, repeater, meta box, custom post types
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A self-contained custom fields manager with repeater support, location rules, and JSON import/export — no third-party dependencies required.

== Description ==

Plinth Custom Fields lets you build custom field groups and attach them to post types, page templates, specific pages, or post statuses — without depending on any other plugin.

**Key features:**

* 12 field types: Text, Textarea, Number, Email, URL, Image, Select, Radio, Checkbox, True/False, WYSIWYG Editor, and Repeater
* Repeater fields with drag-to-reorder rows and nested sub-fields
* Location rules with AND/OR logic — show fields only where you need them
* Import and export field groups as JSON, so you can move configurations between sites
* Template functions for theme developers: `plinth_get_field()`, `plinth_the_field()`, `plinth_get_image()`, `plinth_get_rows()`, `plinth_have_rows()`, `plinth_the_row()`, `plinth_get_sub_field()`, `plinth_the_sub_field()`
* All data stored in standard `wp_postmeta`, prefixed with `_plinth_` so it never collides with other plugins
* Zero external dependencies — works entirely on top of WordPress core

= For Theme Developers =

Once a field group is created and assigned to a location, pull the values into any template file:

`
<?php
$title = plinth_get_field( 'hero_title' );
$image = plinth_get_image( 'hero_image', null, 'large' );

if ( plinth_have_rows( 'team_members' ) ) :
    while ( plinth_rows_remaining() ) : plinth_the_row(); ?>
        <h3><?php plinth_the_sub_field( 'name' ); ?></h3>
    <?php endwhile;
endif;
?>
`

== Installation ==

1. Upload the `plinth-custom-fields` folder to the `/wp-content/plugins/` directory, or install directly through the WordPress Plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Plinth Custom Fields → Add New** to create your first field group.
4. Set Location Rules to choose where the field group should appear.
5. Edit a matching post or page to see your custom fields in a meta box.

== Frequently Asked Questions ==

= Does this require any other plugin? =

No. Plinth Custom Fields is fully self-contained and has zero dependencies on any other plugin.

= Can I move field groups between sites? =

Yes. Go to **Plinth Custom Fields → Import / Export** to export a JSON file of your field groups, then import that same file on another site.

= How do repeater fields store their data? =

Repeater rows are stored as individual `wp_postmeta` rows (a row-count meta key plus one meta key per cell), which keeps the data simple to query directly from the database if needed.

= Will this conflict with my theme's existing custom fields? =

All meta keys are prefixed with `_plinth_` and the leading underscore keeps them out of WordPress's native Custom Fields panel, minimizing collision risk with other plugins or theme code.

== Screenshots ==

1. Field Groups list page
2. Field group editor — adding fields and location rules
3. Repeater field on the post edit screen

== Changelog ==

= 1.0.0 =
* Initial release.
* 12 field types including Repeater with drag-sort and nested sub-fields.
* Location rules engine with AND/OR logic.
* JSON import/export for field groups.
* Template functions for theme developers.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
