- What is pollora/metabox and what problem does it solve?
- pollora/metabox is a Laravel-friendly toolkit for creating WordPress custom metaboxes with a fluent PHP API. It lets you define boxes and fields declaratively, attach them to post types, and handle rendering and secure saving instead of scattering procedural WordPress code. It fits into Pollora's Laravel-powered WordPress stack.
- How do I install pollora/metabox in a Laravel project?
- Install it with Composer using composer require pollora/metabox. Then follow the package's configuration and registration conventions for your Pollora or Laravel WordPress setup. Because the README excerpt is not available here, check the package documentation for any service provider, config publishing, or setup steps.
- Which Laravel versions does pollora/metabox support?
- The provided context does not list exact Laravel version constraints. It is described as Laravel-friendly and intended for Pollora's Laravel-powered WordPress stack. Check the package's composer.json and release notes for supported Laravel and PHP versions before adopting it.
- How do I define a custom metabox and fields with pollora/metabox?
- Use the fluent builder to define a metabox, then add fields to it in PHP. You attach the box to the relevant post types and let the package handle rendering. The declarative API is meant to replace repetitive metabox registration and field markup boilerplate.
- Does pollora/metabox handle sanitization and secure saving of post meta?
- Yes, the package is described as providing secure persistence for saving and retrieving post meta. It handles save logic so you do not need to wire every WordPress nonce, capability, and sanitization step manually in scattered procedural code. You should still validate any field-specific requirements in your own configuration.
- Can I add custom field types or extend field support?
- The package advertises extensible field support for common and custom inputs. That means you can use built-in field types for typical metabox needs and extend the system when your project requires custom inputs. Review the package's field API for the exact extension points.
- How do I attach a metabox to specific post types or display rules?
- The fluent builder includes display rules and lets you attach boxes to post types. You define the target post type and any relevant display conditions in PHP. The package then uses those rules when rendering the metabox in the WordPress admin.
- How do I retrieve saved metabox values in my theme or application?
- The package provides secure persistence for saving and retrieving post meta. In practice you retrieve the stored meta through the package's API or standard WordPress post meta functions, depending on how the field is configured. Check the package documentation for the recommended retrieval method in Pollora.
- Is pollora/metabox suitable for production WordPress sites?
- It is designed for Laravel-powered WordPress projects and emphasizes secure persistence and maintainable code. Production suitability depends on your supported versions, testing, and how you configure sanitization and capabilities. Because exact maintenance details are not provided, review its release activity and test in staging first.
- What are alternatives to pollora/metabox for WordPress custom fields?
- Alternatives include manual WordPress add_meta_box code, popular metabox libraries, and other Laravel and WordPress integration packages. pollora/metabox differentiates itself with a fluent Laravel-friendly API and secure save handling within the Pollora stack. Choose based on your field complexity, Laravel version, and maintenance needs.