Skip to content

Instantly share code, notes, and snippets.

@bogdan-mainwp
Created March 8, 2019 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogdan-mainwp/a1e56b6ae16d43880168dab87a879a79 to your computer and use it in GitHub Desktop.
Save bogdan-mainwp/a1e56b6ae16d43880168dab87a879a79 to your computer and use it in GitHub Desktop.
Custom code snippet to change code editor height and background color for the Code Snippets extension.
<?php
// Add the following code snippet to the functions.php file of the MainWP Customisations plugin
// Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations
// More about the plugin: https://mainwp.com/mainwp-customisations/
add_filter( 'mainwp_codesnippets_editor_attr', 'myhook_mainwp_codesnippets_editor_attr', 10);
function myhook_mainwp_codesnippets_editor_attr( $data ) {
$data['height'] = 500;
// supported themes: 'erlang-dark', 'night', 'xq-dark', 'xq-light', 'the-matrix', 'eclipse'
$data['theme'] = 'eclipse';
return $data;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment