Linux 软件免费装
Banner图

Clipboard Snippet Copier

开发者 webcodingplace
更新时间 2026年5月25日 14:03
捐献地址: 去捐款
PHP版本: 7.2 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

gutenberg block copy clipboard code snippet copy shortcode

下载

1.4

详情介绍:

Clipboard Snippet Copier lets you share ready-to-use shortcodes, demo layouts, or any reusable code snippets with your visitors. Click a button and the snippet is copied straight to their clipboard. No manual selection, no copy/paste errors. You decide whether the snippet stays hidden (fetched only when copied) or is displayed inline as a styled code block. Either mode is one click away for the visitor. Why use it? Key features How it works
  1. You add a snippet in Code Snippets → Add New and note its ID.
  2. You drop the Clipboard Snippet block (or the [clipsnco_code_copy_btn] shortcode) onto any page.
  3. When a visitor clicks the button, the snippet is fetched over AJAX and written to their clipboard — without ever appearing in the page source (unless you turned on inline mode).

安装:

  1. Upload the plugin files to /wp-content/plugins/clipboard-snippet-copier, or install it directly from the WordPress.org repository.
  2. Activate the plugin through the Plugins screen.
  3. Go to Code Snippets → Add New to create your first snippet.
  4. Insert the Clipboard Snippet block on any page, or paste the shortcode below.

屏幕截图:

  • Editing a snippet — the CodeMirror editor keeps indentation and syntax intact.
  • The Settings page (default label, default class, tooltip text, guest-access toggle).
  • The **Clipboard Snippet** Gutenberg block with its sidebar controls.
  • A copy button on the frontend, with the success tooltip.
  • Inline mode rendering the snippet as a styled `<pre><code>` block.

升级注意事项:

1.4 Adds a Gutenberg block, inline show-the-code mode, a settings page, per-snippet copy counter and CodeMirror editing. Drop-in upgrade — existing shortcodes keep working unchanged.

常见问题:

Can I use multiple buttons on the same page?

Yes. Drop as many blocks/shortcodes as you like — each one copies its own snippet.

Will the snippet appear in the page source?

Only if you enable inline mode. In the default hidden mode the snippet lives in the WordPress admin and is fetched over AJAX the moment the button is clicked.

Does it work with page builders like WPBakery or Elementor?

Yes. Place the [clipsnco_code_copy_btn] shortcode in any text/HTML widget, content block or builder element.

Can I show the code on the page AND have a copy button?

Yes — that's inline mode. Set inline="yes" on the shortcode or flip the Show code inline toggle on the block.

Does this play nicely with syntax highlighters?

Yes. In inline mode, add the language attribute (language="php", language="js", …) and the plugin emits a matching language-xxx class on the <code> element. Prism.js, highlight.js and most other highlighters pick that up automatically.

Where can I see how many times a snippet has been copied?

Go to Code Snippets in the admin. The Copies column shows the running total; click the header to sort.

Can I prevent non-logged-in visitors from copying snippets?

Yes. Code Snippets → Settings → Allow guests controls this.

Does the plugin require jQuery?

No. The frontend script uses native fetch and the Clipboard API, with an execCommand fallback for older/insecure contexts.

Is the plugin translation-ready?

Yes — text domain clipboard-snippet-copier, translations loaded from the /languages folder.

更新日志:

1.4 1.2 1.1 1.0