JoeSz / Exopite-Simple-Options-Framework

Fast, easy and lightweight admin options/metabox form generator for WordPress Plugins and metaboxes.
GNU General Public License v3.0
78 stars 24 forks source link

Why html tags in TinyMCE editor are removing? #38

Closed KingMatrix1989 closed 1 year ago

KingMatrix1989 commented 2 years ago

Hi. It seems content of editor field of type TinyMCE (default) is sanitized after save options and html tags is removing.

Why?

JoeSz commented 2 years ago

I just installed a clean WordPress with the test plugin. I couldn't reproduce it. Which version are you using? Which HTML tag is the problem?

Allowed HTML tags: (https://developer.wordpress.org/reference/functions/wp_kses_allowed_html/)

$allowed_html = wp_kses_allowed_html( 'post' );

And you can also override (add your own) sanitizing hook to the field. For example:

array(
    'id'          => 'text_1',
    'type'   => 'editor',
    'title'  => 'Editor TinyMCE',
    'sanitize'    => array( $this, 'test_sanitize_callback' ),
    ...
),
JoeSz commented 1 year ago

Closing issue due to lack of response.