I try too add code highlighting for blog with TinyMCE 4.3.1 capabilities. At first I don't understand why I don't have this plugin in wp-includes/js/tinymce/plugins folder after WP update, so I have to insert it manually.
I added such filter:
function mytheme_tinymce_settings( $settings ) {
$settings['plugins'] .= ",codesample";
$settings['toolbar1'] .= ",codesample";
return $settings;
}
add_filter( 'tiny_mce_before_init', 'mytheme_tinymce_settings' );
So now I have button to add code snippets and it highlighted well in editor field, but when I publish post simple pre appears.
When I add filter than /wp-includes/js/tinymce/plugins/codesample/plugin.min.js?wp-mce-4310-20160418 appears in both pages: edit page and post view page, but works only for edit page.
How to make it work on post view page?