Tento plugin nebol testovaný s najnovšími 3 hlavnými vydaniami WordPress. Už nemusí byť udržiavaný alebo podporovaný a môže mať problémy s kompatibilitou pri použití s novšími verziami WordPress.

Code Click to Copy

Popis

Simple plugin that automatically copies content in <pre> and <code> tags to clipboard (when clicked). Other plugins out there do the same but create a little [COPY] button that you have to aim for. Mine doesn’t require any aiming, just click anywhere on the code block and it copies the whole thing.

For any sites sharing code-commands, this plugin will save users time from having to highlight and copy-paste bits of text back and forth. It’s especially helpful for large globs of code that scroll off-screen, or when copying on your mobile phone.

Inštalácia

  1. Install easily from your dashboard Add Plugins page or manually download the plugin and upload the extracted archived to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‚Plugins‘ menu in WordPress.

Časté otázky

Does this plugin work with newest WP version and also older versions?

Yes, this plugin works perfect with the latest version of WordPress! It also works with older versions as well but you should always run the latest WordPress and PHP version for best security and performance. This plugin is used in my critical sites so you can be assured it works perfect.

Will this plugin slow down my site?

No. It’s coded extremely lightweight. The plugin CSS and JS is only 1.7KB total, and inlined in your site footer. No extra CSS or JS files are loaded. It does only the essential function and nothing more. No heavy PHP processing or database queries. I’m an absolute speed fanatic.

Do you plan to add more features?

Not unless someone wanted to pay for my development time and costs. This was intended as a free community plugin.

How do I style the copy block?

You can style the „codecopy_tooltip“ CSS class. Change background, color, font-family, font-size, padding, word-wrap, overflow, etc. I might add this option in the plugin one day but just trying to keep it lightweight for now.

Any known incompatibility issues?

One user reported it didn’t work on his DIVI site through DIVI’s own „code“ block mechanism.

Recenzie

19. augusta 2022
You the man. So light and simple. My only change was to add a pseudo element to display a copy to clipboard icon in the corner of the code blocks, because otherwise people have no idea its copyable until they hover. Using pointer-events:none on the icon allows it to not interfere with the click functionality. Maybe something like that could be an option or even just a filer hook for people to optionally enable. Anyway, cheers!
Prečítať všetkých 9 recenzií

Prispievatelia a vývojári

“Code Click to Copy” je softvér s otvoreným zdrojovým kódom. Do tohto pluginu prispeli nasledujúci ľudia.

Prispievatelia

„Code Click to Copy“ bol preložený do 5 jazykov. Ďakujeme prekladateľom za ich príspevky.

Preložiť „Code Click to Copy“ do vašho jazyka.

Máte záujem o vývoj?

Prehľadávajte zdrojový kód, preskúmajte SVN repozitár, alebo sa prihláste na odber vývojárskeho logu cez RSS.

Zoznam zmien

0.1.4

  • It was tested in WP 6.4.2. Program code was cleaned professionally.

0.1.3

  • Multi language is supported. Please make language .po and .mo files in /languages folder. Chinese language file is provided as an example.

0.1.2

Updated description.

0.1.1

  • Fix parsin error on readme.txt file.

0.1.0

  • Initial Release