parsedown-party icon indicating copy to clipboard operation
parsedown-party copied to clipboard

Increase Editor Size

Open dac514 opened this issue 7 years ago • 1 comments

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.

dac514 avatar Sep 04 '18 15:09 dac514

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 );

dac514 avatar Nov 17 '18 17:11 dac514