Color field type

Enter a color in a text input box or choose a color from the drop down.

Return values

The selected color in hexadecimal format.

If not color is selected an empty string is returned.


// field slug is "colorExample"
$selected_color = simple_fields_value('colorExample');
echo "You selected the color #" . $selected_color . ".";


You selected the color #68FF57.

One thought on “Color field type

  1. john

    I’m getting ffffff by default. I’d rather have the empty string you talk about. Once user upadates post ffffff is set and can’t be removed.

Leave a Reply