You have a chance to win a

Discount

Icon Picker

The Icon Picker field lets you easily select a Dashicon, a Media Library image, or provide a URL for an image or SVG.

Screenshots

ECM Icon Picker Field Type

Validation Settings

  • Required: Toggle to make the field mandatory (default: off).
ECM Icon Picker Validation Settings

Conditional Logic Settings

  • Enable: Toggle to activate conditional logic for the field (default: off).
  • Show this field if: Rule setup with dropdowns for field (e.g., “text”), condition (e.g., “Value is equal to”), and value (e.g., “Name”), plus “And” operator.
  • OR: Separator for alternative rule groups.
  • Add Rule Group: Button to create additional rule sets.
ECM Icon Picker Conditional Logic settings

Screenshots

Showing icon picker in modern UI
Showing icon picker in modern UI
Showing Icon picker in Gutenberg UI
Showing Icon picker in Gutenberg UI

Template Usage

The Icon field stores an icon identifier (string).

Display icon (FontAwesome example)

<?php $icon = ecm_get_field('my_icon'); ?>
<?php if ($icon): ?>
    <i class="<?php echo esc_attr($icon); ?>"></i>
<?php endif; ?>

Display with text

<?php $icon = ecm_get_field('my_icon'); ?>
<?php if ($icon): ?>
    <span class="icon-label">
        <i class="<?php echo esc_attr($icon); ?>"></i> Download
    </span>
<?php endif; ?>