=== Easy Architect === Contributors: juergen74 Donate link: https://www.paypal.com/donate?hosted_button_id=SQH5ZTLK3RY7Q Tags: custom post type, admin, meta, custom fields, templates Tested up to: 6.8 Stable tag: 1.0.2 Requires at least: 6.7 Requires PHP: 7.4 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html Create custom post types and dynamic templates without coding. == Description == **Easy Architect** lets you design and manage custom post types and dynamic templates directly from the WordPress admin — no coding required. Fits perfectly into the WordPress UI and offers an intuitive meta field management. **Features:** * Add, edit, and delete custom post types from the admin * Manage meta fields in the block editor sidebar, just like categories or tags * Add custom fields (meta) to any post type via a "Meta" submenu (just like Categories/Tags) * Order meta fields via drag & drop for custom field arrangement * Support for multiple meta field types: text, image, date, time, datetime * Enhanced Group block: Optionally hide groups if their meta fields are empty * Configure all standard post type settings (supports, visibility, capabilities, etc.) * Choose menu icons with a Dashicon picker or use a custom SVG/URL * No coding knowledge required * Clean, minimal, and fast * Maximal integration into the WordPress admin and block editor * Create dynamic templates that adapt to your content == Meta Fields & Block Editor Integration == **Meta Submenu for Every Post Type** * Each custom post type (and the default "Posts") gets a **Meta** submenu in the admin, similar to how Categories and Tags work. * Here, you can add and manage custom fields (meta) for each post type, with a familiar and user-friendly interface. * Reorder meta fields easily to control their display order in the editor. * Choose from multiple meta field types: text, image, date, time, datetime. **Block Editor Sidebar Integration** * In the block editor, a new **Meta** panel appears in the sidebar. * You can view and edit all registered meta fields for the current post type directly from the editor. * You can also add new meta fields right from the sidebar, making it easy to extend your content structure on the fly. * Meta fields of type "image", "date", "time", and "datetime" have dedicated controls for a better editing experience. **Meta Registration & Usage** * Meta fields are registered using `register_meta()` in PHP, ensuring they are available everywhere in WordPress (REST API, block editor, etc.). * You can use these meta fields in supported blocks (e.g., Paragraph, Heading, Image) by binding block attributes to the custom field. **Enhanced Group Block** * The core Group block is enhanced: * If a meta field is inside a Group, you get a new option: **"Hide Group if Meta is empty"**. * This allows for dynamic, conditional layouts—if a custom field is empty, the entire group can be hidden on the frontend. **Workflow Example** 1. **Create a Post Type** (e.g., "Book"). 2. **Add Meta Fields** (e.g., "Author", "ISBN", "Publisher") via the Meta submenu. 3. **Edit a Book** in the block editor: * Fill in meta fields in the sidebar. * Use blocks and groups to design your template. * Optionally, set groups to hide if their meta is empty. 4. **Frontend:** Your template displays only the groups/fields with content, keeping your design clean and dynamic. **Benefits** * No coding required for most tasks—everything is manageable from the admin and block editor. * Flexible layouts: Show/hide sections based on meta content. * Consistent UI: Meta management feels like native WordPress features. * Developer-friendly: All meta is registered and accessible via standard WordPress APIs. == Installation == 1. Upload the plugin files to the `/wp-content/plugins/easy-architect` directory, or install through the WordPress plugins screen. 2. Activate the plugin through the 'Plugins' screen in WordPress. 3. Go to **Settings > Post Type** to add or manage your custom post types. == Frequently Asked Questions == = Can I use custom SVG or image icons? = Yes! In the "Menu Icon" field, you can enter a Dashicon class, a URL to an image, or a base64-encoded SVG. = How do I add custom fields (meta) to my post type? = Each post type gets a "Meta" submenu in the admin, where you can add and manage custom fields. These fields are registered with WordPress and available in the block editor sidebar. You can also just add them in the editor sidebar directly. = Can I use meta fields in the block editor? = Yes! All registered meta fields are available in the block editor sidebar, and you can use them in any block. The Group block can be set to hide if its meta fields are empty. = Will this plugin work with my theme? = Yes, custom post types and meta fields created with this plugin are standard WordPress features and work with any well-coded theme. But it's working best with Block Themes. == Screenshots == 1. Add a new custom post type using the intuitive Dashicon picker. 2. Custom post type created! Click "Edit" to configure advanced options. 3. Standard settings are pre-filled for convenience – ideal for most users. 4. Manage custom fields (meta) easily from the dedicated Meta submenu. 5. Add or edit meta fields directly in the block editor sidebar for quick access. 6. Create a template for single items (e.g., a "Book") using the block editor. 7. Design your template with standard WordPress blocks. Connect Paragraph and Heading blocks to meta fields via the Attributes → Content panel. 8. Use meta fields inside a Group block to enable the "Hide Group if Meta is empty" option for dynamic layouts. 9. Preview your content in the editor with meta fields. 10. Display your meta data on the frontend—only fields with content are shown for a clean, dynamic presentation. == Changelog == = 1.0.2 = * Improved image select control for meta fields in the editor. * Unified and translated meta type labels throughout the plugin. * Refactored type handling for better maintainability and REST API integration. * Enhanced error handling for REST API and editor sidebar. = 1.0.1 = * Fix: Resolved an issue where the editor JavaScript (index.js) was not loading due to an incorrect dependency handle in the build output. The plugin sidebar and meta features now load reliably in the block editor. = 1.0.0 = * Initial release