Themosis framework release 2.0.3

A new minor release with long-awaited fixes and new Blade template directives 🚀

Updates

New Blade directives for forms

The release provides new Blade directives in order to help you render a form on your page.

The @form($form) directive helps you render a form instance:

// Before
{!! $form->render() !}}

// After
@form($form)

Simply pass your form instance as the directive parameter and behind the scene, it renders your complete HTML form within your page.

We also added more granular directives in order to control form open and close tags as well as rendering a single field attached to a form.

The @formOpen($form) and @formClose($form) directives open and close a form HTML tags respectively. The @formField($form, 'field-name') directive helps you render a field attached to the form instance.

Thanks to those 3 directives, it is now easier to build forms with a custom HTML layout as you can control where to display each field while keeping form validation and other features benefits. For example:

<div class="container">
    @formOpen($form)
    <div class="column-left">
        @formField($form, 'firstname')
        @formField($form, 'lastname')
        @formField($form, 'email')
    </div>
    <div class="column-right">
        @formField($form, 'message')
        @formField($form, 'submit')
    </div>
    @formClose($form)
</div>

If you feel that the default form layout generated by the framework does not suit your project, feel free to explore those custom blade directives to build your forms.

API requests identification

The release contains a new minor change regarding core API requests. When the framework is performing requests to fetch data for the metabox custom fields for example, each request contains a custom header:

Themosis-Api-Request: 1

The header allows to filter or write conditional logic against requests done by the framework. Because those requests are performed through a custom route, it might happen that they conflict with some rare-case of WordPress core issues.

Fixes

  • Fix custom taxonomy display. When creating a custom taxonomy for a specific post type, it kept being displayed on all post type screens.
  • Fix metabox field validation messages display.
  • Fix field values at rendering.
  • Fix choice field in order to support numeric values.
  • Fix WordPress administration page inheritance. It is now possible to set another custom page as a parent.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your email address will not be published. Required fields are marked *