Support » Plugin: Search Everything » Getting error when using Hex color for highlight

  • When I use a Hex color for the highlight color it returns an error when submitting. It only takes named colors.

    Error I’m getting

    “Oops, there are errors in your submit:
    field Highlight Background Color should be a css color (‘red’ or ‘#abc123’)

    I tried every combination of
    #E74198 <- this is the one that should work for sure

    All these error out. I had to choose from the list of official color names.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stevegibson12


    I did more testing, looks like the issue is it doesn’t take capital letters, whether it’s part of a named color or in the hex value. Seems like a simple fix. Perhaps I’ll submit a fix for it.

    Thread Starter stevegibson12


    Here’s one way to fix it. Update the regex for “color” to include A-Z and A-F, respectively. Inside search-everything/options.php.

    function se_validation($validation_rules) {
    $regex = array(
    “color” => “^(([a-zA-Z]+)|(#[0-9a-fA-F]{2,6}))?$”,
    “numeric-comma” => “^(\d+(, ?\d+)*)?$”,
    “css” => “^(([a-zA-Z-])+\ *\:[^;]+; *)*$”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting error when using Hex color for highlight’ is closed to new replies.