Tiny MCE image alignment and manual resizing

Question

I’m searching a solution to remove the differents possibilities of alignment of images in TinyMCE editor in WordPress and remove the manual resizing by mouse.
I already done the last one with this in css, but it could exist a better way :

/* Remove sizing on image */
div#mceResizeHandlenw,
div#mceResizeHandlene,
div#mceResizeHandlese,
div#mceResizeHandlesw {
    display: none;
}

enter image description here

And when we are editing the images :

enter image description here

I tried with this without succes :

function remove_wpeditimage($plugins){
    print_r($plugins);
    if(($key = array_search('wpeditimage', $plugins)) !== false) {
        unset($plugins[$key]);
    }
    print_r($plugins);
    if(($key = array_search('teeny_mce_plugins', $plugins)) !== false) {
        unset($plugins[$key]);
    }
    return $plugins;
}
add_filter( 'tiny_mce_plugins', 'remove_wpeditimage', 20, 2 );

Thank’s for your help.

Regards.

0
, , , , Delirium6 3 years 2020-07-06T03:10:22-05:00 0 Answers 64 views 0

Leave an answer

Browse
Browse