Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

quicktags_p-hr-pre

// Add Quicktags
function custom_quicktags() {

	if ( wp_script_is( 'quicktags' ) ) {
	?>
	<script type="text/javascript">
	QTags.addButton( 'eg_paragraph', 'p', '<p>', '</p>', 'p', 'Paragraph tag', 1 );
	QTags.addButton( 'eg_hr', 'hr', '<hr />', '', 'h', 'Horizontal rule line', 201 );
	QTags.addButton( 'eg_pre', 'pre', '<pre>', '</pre>', 'q', 'Preformatted text', 111 );
	</script>
	<?php
	}

}

// Hook into the 'admin_print_footer_scripts' action
add_action( 'admin_print_footer_scripts', 'custom_quicktags' );