HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/martyknows.com/wp-content/plugins/enlighter/modules/core/KSES.php
<?php

namespace Enlighter;

// @see https://codex.wordpress.org/Function_Reference/wp_kses
class KSES{

    // enable EnlighterJS html attributes for Authors and Contributors
    public static function allowHtmlCodeAttributes($data, $context){
        // only apply filter on post-context
        if ($context === 'post'){

            // list of all available enlighterjs attributes
            $allowedAttributes = array(
                'data-enlighter-language' => true,
                'data-enlighter-theme' => true,
                'data-enlighter-group' => true,
                'data-enlighter-title' => true,
                'data-enlighter-linenumbers' => true,
                'data-enlighter-highlight' => true,
                'data-enlighter-lineoffset' => true
            );

            // apply to pre and code tags
            if (isset($data['pre'])){
                $data['pre'] = array_merge($data['pre'], $allowedAttributes);
            }
            if (isset($data['code'])){
                $data['code'] = array_merge($data['code'], $allowedAttributes);
            }
        }

        return $data;
    }

}