Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 978 Bytes

message.mdx

File metadata and controls

50 lines (33 loc) · 978 Bytes

Message

A UI-only informational notice rendered inside the meta box. Useful for instructions, warnings, or contextual help.


PHP API

Field::message(string $key): MessageField

Type-specific methods

->content(string $html): static

The HTML content to display.

->type(string $type): static

Visual style. Options: 'info' (default), 'warning', 'error', 'success'.


Storage

UI-only — never stored.


Example

Field::message('seo_notice')
    ->content('<strong>SEO tip:</strong> Keep the meta title under 60 characters.')
    ->type('info'),

Field::message('danger_zone')
    ->content('Changing this field will clear the page cache. <a href="#">Learn more</a>.')
    ->type('warning'),

Notes

  • The key is required by the API but has no functional purpose for message fields.
  • HTML in ->content() is rendered unescaped — keep it under developer control, never from user input.