ECM Flat Discount

Create and manage custom content in WordPress without complexity.

Select

The Select field provides a dropdown menu with predefined choices for selection.

Screenshots

ECM Select Field Type

Validation Settings

Required: Toggle to make the field mandatory (default: off).

Allow Multiple: Toggle to permit selection of multiple options (default: off).

ECM Select 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 Select Conditional Logic settings

Screenshots

Showing select field in modern UI
Showing select field in modern UI
Showing select field in Gutenberg Editor
Showing select field in Gutenberg Editor

Template usage

Display single selected value

This example shows how to retrieve and display a single selected value from a Select field.

<p>Color: <?php echo esc_html ( ecm_get_field('color') ); ?></p>

Display multiple values

This example shows how to retrieve and display multiple selected values from a Select field.

<?php

$colors = ecm_get_field( 'color' );

// Create a comma-separated list from selected values.

if( $colors ): ?>

<p>Color: <?php echo implode( ', ', $colors ); ?></p>

<?php endif; ?>