Inline style HTML attribute is being stripped from all elements of a post

This is because what you’re trying to do trips a security feature, post content is passed through wp_kses_post to strip out dangerous tags Administrators however, have the unfiltered_html capability, which allows them to put arbitrary dangerous HTML in content and titles. This is why you’re able to insert the tags via the editor. This still … Read more

How to set default post editor based on role?

create_function() is deprecated as of PHP 7.2.0, so you should avoid using it. Instead, use an anonymous function. Additionally, it’s better the check the current user role inside the callback function, so that the current user role is checked when the filter is applied, not when the hook is added, which could be before the … Read more

How to add custom table style for table block in gutenberg editor

The register_block_style function is what you’ll want. The basic implementation is register_block_style( ‘core/table’, array( ‘name’ => ‘my-table-style’, ‘label’ => ‘My Table Style’, ) ); When you select the style, it will add the is-style-my-table-style class to the block, which you can style using your style.css or other stylesheet. There are two other implementations, where you … Read more

inside in editor

This is entirely possible, as I just tested it in WordPress. Create your unordered list Add four items: “First list,” “Second list,” “Sub Second List,” “Third List” Place the cursor on “Sub Second List” and click Indent (you will need to expand the kitchen sink to access the indent button With the cursor still on … Read more

Change default italic from to in admin editor

Are you sure editor use <i> for italics? I’m almost sure it uses <em>. However, if you want to be absolutely sure there are no <i> in your post content, let editor do what it want and then replace <i> with <em> before creating/updating posts, hooking wp_insert_post_data filter, just like: add_filter(‘wp_insert_post_data’,’replace_em’, 20, 1); function replace_em( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)