Overview
The Info field renders a styled notice block — no input, no saved value. It is purely for display purposes inside the options panel. Use it to add context between fields, explain a group of settings, warn about dependencies, or provide usage instructions. Supports plain text and basic HTML.
Field Registration
php
[
'id' => 'typography_info',
'type' => 'info',
'title' => __('Typography Settings', 'your-textdomain'),
'desc' => __('Changes to typography settings will be reflected across all pages. Google Fonts are loaded automatically.', 'your-textdomain'),
]
Field Options
| Option | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique field identifier — not stored, but required for internal rendering |
type | string | ✅ | Must be info |
title | string | — | Bold heading text shown at the top of the notice |
desc | string | — | Body text of the notice — supports basic HTML |
style | string | — | Notice style variant — info (default), success, warning, error |
required | array | — | Conditional logic rules — see Conditional Logic |
Return Value
None. The Info field stores no value and returns nothing from themeplus_get_option().
Usage Examples
Basic informational notice
php
[
'id' => 'color_info',
'type' => 'info',
'title' => __('Color Settings', 'your-textdomain'),
'desc' => __('Set the main brand colors for your theme. These are applied globally via CSS custom properties.', 'your-textdomain'),
]
Warning notice
php
[
'id' => 'cache_warning',
'type' => 'info',
'style' => 'warning',
'title' => __('Caching Notice', 'your-textdomain'),
'desc' => __('If you are using a caching plugin, clear your cache after saving changes to see them take effect on the frontend.', 'your-textdomain'),
]
Success notice
php
[
'id' => 'setup_complete',
'type' => 'info',
'style' => 'success',
'desc' => __('Your theme is configured and ready. Visit your site to see the result.', 'your-textdomain'),
]
Error / dependency notice
php
[
'id' => 'woocommerce_required',
'type' => 'info',
'style' => 'error',
'title' => __('WooCommerce Required', 'your-textdomain'),
'desc' => __('The shop settings below require WooCommerce to be installed and activated.', 'your-textdomain'),
]
With HTML in desc
php
[
'id' => 'font_info',
'type' => 'info',
'desc' => __('Choose fonts from the <strong>Google Fonts</strong> library. Browse available fonts at <a href="https://fonts.google.com" target="_blank" rel="noopener noreferrer">fonts.google.com</a>.', 'your-textdomain'),
]
As a section divider with a conditional
php
[
'id' => 'enable_custom_fonts',
'type' => 'toggle',
'title' => __('Enable Custom Fonts', 'your-textdomain'),
'default' => false,
],
[
'id' => 'custom_fonts_info',
'type' => 'info',
'style' => 'info',
'desc' => __('Select a Google Font for each text element below. Fonts are loaded automatically — no extra setup needed.', 'your-textdomain'),
'required' => ['enable_custom_fonts', '==', true],
],
[
'id' => 'body_typography',
'type' => 'typography',
'title' => __('Body Typography', 'your-textdomain'),
'required' => ['enable_custom_fonts', '==', true],
],
Notes
- The
idmust still be unique within the section even though the field stores no value. - The
styleoption controls the visual appearance of the notice block — usewarningorerrorto draw attention to important dependencies or limitations. - Basic HTML tags like
<strong>,<em>,<a>, and<br>are supported indesc. Avoid complex markup. - Info fields support
requiredconditional logic — use this to show contextual notices only when a related setting is active.