parsedown-party
parsedown-party copied to clipboard
Increase Editor Size
This is not currently possible. CodeMirror inherits the defaults of the textarea.
It could be done by modifying the code from:
wp_add_inline_script(
'code-editor',
sprintf( 'jQuery( function() { wp.codeEditor.initialize( "content", %s ); } );', wp_json_encode( $settings ) )
);
To:
wp_add_inline_script(
'code-editor',
sprintf( 'jQuery( function() { var x = wp.codeEditor.initialize( "content", %s ); x.codemirror.setSize(null, 500); } );', wp_json_encode( $settings ) )
);
And replacing 500 with the numbers of pixels someone wants as the height.
Because this plugin has no options page I don't know where to put this option. Should we use add_filter?
Deep thoughts. Pull requests welcome.
wp_editor() accepts an an editor_height setting. It could be set with the wp_editor_settings filter.
\_WP_Editors::editor\_WP_Editors::parse_settings$settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );