Posts

Showing posts from October, 2024

How to access content area width and height in wp editor

 In some cases, we need to access the width & height of content area size in pixel. Here is the solution which I already tested during my working time. function checkEditorSection () {     // Select the editor content area     const editorSection = document . querySelector ( '.interface-interface-skeleton__content' );         if ( editorSection ) {         // Get the size of the editor section         const editorSize = editorSection . getBoundingClientRect ();                 // Output width and height         console . log ( 'Editor Width:' , editorSize . width );         console . log ( 'Editor Height:' , editorSize . height );     } else {         // Retry after a short delay if the section isn't found yet         console . log ( "Retrying... Editor section n...