Support

Account

Home Forums Backend Issues (wp-admin) select2_escape_markup

Unread

select2_escape_markup

  • Hi, we have a select2 list of icons which return the relative URL e.g;

    icons/red/cross.png : red cross
    icons/green/square.png : green square

    I’d like to show the image alongside the value, so I tried to use the select2_escape_markup filter but I can’t find any reference to the value of the option anywhere in any of the arguments (escaped_value, original_value, $select, settings, field, instance).

    Can anyone help?

    acf.addFilter(‘select2_escape_markup’, function(escaped_value, original_value, $select, settings, field, instance) {
    if(field.data.name == ‘icon’) {
    return original_value + ‘ ‘;
    }
    return escaped_value;
    });

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.