Linux 软件免费装
Banner图

WPBetterCodeHighlighting

开发者 conlabltd
更新时间 2026年1月4日 05:38
PHP版本: 6.0 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

code syntax highlight code snippets tutorial sites

下载

1.0

详情介绍:

WpBetterCodeHighlighting is built on the popular JS Library PrismJS. Unlike other code snippet plugins this one is completely free and uses a shortcode rather than a Gutenberg block this means it works with themes too. Allowing you to showcase code snippets on your wordpress tutorial site or blog site. WpBetterCodeHighlighting Key Features Example usage (shortcode): `[wpbch language='html'] Your code goes here. This would be another line of code etc etc. [/wpbch]` Arguments for shortcode: language - default null, will display an error if a language acronym is not provided, see supported languages section below for a list of supported languages. line_numbers - default true provide false if you wish to disable line numbers. copy_button - default true provide false if you wish to disable the copy button. copy_button_text - default Copy provide a different value if you wish to change the copy button default text. copy_button_success - default Copied! Provide a different value if you wish to change the success copy button message. copy_button_error - default Error provide a different value if you wish to change the error copy button message. Full Shortcode Example: [wpbch language='html' line_numbers=true copy_button=true copy_button_text='Copy Me' copy_button_success='Yay you copied me' copy_button_error='Oops you failed to copy me']<p>Your code goes here.</p>[/wpbch] Replace html with one of the supported languages acronyms below. For example apacheconf for Apache Config. Full List Of Supported languages: Language Name | Acronym to be used in language argument

屏幕截图:

  • Example of the shortcode being used in the Divi Text Module.
  • Example of custom whitelabeling.

常见问题:

Can I really whitelabel the front end?

Yes, I made this plugin to be useful. If you want to remove the powered by shown in the bottom left? No hard feelings chuck the below in your functions.php it's completely free. add_filter( 'wpbch_powered_by', function( $powered_by ) { return ''; }); Or add your own message: add_filter( 'wpbch_powered_by', function( $powered_by ) { return 'Anything you want here.'; }); You can also return html for example: add_filter( 'wpbch_powered_by', function( $powered_by ) { return '<img src='yourlogo'>'; });

How many languages are supported?

At the moment there are over 290+ languages.

Can I customise the copy button?

Yes you can customise the copy button by using the below shortcode arguements: copy_button - default true provide false if you wish to disable the copy button. copy_button_text - default Copy provide a different value if you wish to change the copy button default text. copy_button_success - default Copied! Provide a different value if you wish to change the success copy button message. copy_button_error - default Error provide a different value if you wish to change the error copy button message.

I need help what do I do?

Need a hand? You can contact me directly at hello@conlab.dev.

更新日志:

1.0