Return to General talk
Home › Forums › Graphene WordPress theme › General talk › graphene_get_content_width() broken on WP 4.7.5
After updating to Graphene theme 22.214.171.124 (from 1.6.x) on WordPress 4.7.5 my Visual Editor (WYSIWYG) was broken, words were wrapping after 1 letter making it hard to editor posts.
Narrowed it down to an inject style in #content_ifr.body width style being 0px.
The buggy code is in options-init.php, function graphene_editor_width, where $content_width is 0;
I patched by commenting out the “add action” below.
– Can you explain the intent of this snippet of code?
– Can you explain why graphene_get_content_width() may be 0 in my case?
– Our of curiousity, why was setTimeout used here, seems very hack-ish.
* Add content width parameter to the WordPress editor
global $content_width, $graphene_settings;
$content_width = graphene_get_content_width();
$(‘#content_ifr’).contents().find(‘#tinymce’).css( ‘width’, ‘<?php echo $content_width; ?>’ );
}, 2000 );
//add_action( ‘after_wp_tiny_mce’, ‘graphene_editor_width’ ); //BUG
You must be logged in to reply to this topic.
Made with by Graphene Themes.