Dashicons in button group options stopped working

Support MB Settings Page Dashicons in button group options stopped working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #50097
    Key_WebdesignKey_Webdesign
    Participant

    I'm using a lot of Button Group fields on setting pages in my projects and lately I've noticed that all the ones with dashicons icons in the options stopped working and render the html in plain text as labels.

    In the documentation, this example is given:

    [
        'id'       => 'styles',
        'name'     => 'Styles',
        'type'     => 'button_group',
        'options'  => [
            'bold'      => '<i class="dashicons dashicons-editor-bold"></i>',
            'italic'    => '<i class="dashicons dashicons-editor-italic"></i>',
            'underline' => '<i class="dashicons dashicons-editor-underline"></i>',
        ],
        'inline'   => true,
        'multiple' => true,
    ],

    But this generates in text labels with the html characters in them.
    It seems there is some kind of filter added to the rendering of the fields that strips the html and breaks this dashicon functionality.

    Could this be addressed?

    #50098
    PeterPeter
    Moderator

    Hello,

    Thank you for your feedback.

    The recent change to Meta Box plugin causes the issue https://github.com/wpmetabox/meta-box/blob/master/inc/walkers/input-list.php#L47

    you can check the file and remove the function esc_html() to fix the issue in the meantime. I will ask the development team to review the changes and let you know when I have more information.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.