{"id":252206,"date":"2025-10-13T14:57:51","date_gmt":"2025-10-13T14:57:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/clipboard-snippet-copier\/"},"modified":"2026-05-21T03:12:49","modified_gmt":"2026-05-21T03:12:49","slug":"clipboard-snippet-copier","status":"publish","type":"plugin","link":"https:\/\/de-ch.wordpress.org\/plugins\/clipboard-snippet-copier\/","author":17556873,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.4","stable_tag":"1.4","tested":"7.0","requires":"5.0","requires_php":"7.2","requires_plugins":null,"header_name":"Clipboard Snippet Copier","header_author":"WebCodingPlace","header_description":"Copy shortcodes or code snippets to clipboard with a single click using AJAX \u2013 without displaying the actual code.","assets_banners_color":"cecfd9","last_updated":"2026-05-21 03:12:49","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/webcodingplace","header_plugin_uri":"https:\/\/webcodingplace.com\/clipboard-snippet-copier","header_author_uri":"https:\/\/webcodingplace.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":473,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.4":{"tag":"1.4","author":"webcodingplace","date":"2026-05-21 03:12:49"}},"upgrade_notice":{"1.4":"<p>Adds a Gutenberg block, inline show-the-code mode, a settings page, per-snippet copy counter and CodeMirror editing. Drop-in upgrade \u2014 existing shortcodes keep working unchanged.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3536562,"resolution":"128x128","location":"assets","locale":"","width":128,"height":127},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3536562,"resolution":"256x256","location":"assets","locale":"","width":256,"height":254}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":3546975,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":3546975,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":{"clipsnco\/copy-button":{"name":"clipsnco\/copy-button","title":"Clipboard Snippet"}},"tagged_versions":["1.4"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":3536562,"resolution":"1","location":"assets","locale":"","width":1913,"height":455},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":3536562,"resolution":"2","location":"assets","locale":"","width":1918,"height":628},"screenshot-3.jpg":{"filename":"screenshot-3.jpg","revision":3536562,"resolution":"3","location":"assets","locale":"","width":1918,"height":631},"screenshot-4.jpg":{"filename":"screenshot-4.jpg","revision":3536562,"resolution":"4","location":"assets","locale":"","width":1918,"height":762},"screenshot-5.jpg":{"filename":"screenshot-5.jpg","revision":3536562,"resolution":"5","location":"assets","locale":"","width":1918,"height":786},"screenshot-6.jpg":{"filename":"screenshot-6.jpg","revision":3536562,"resolution":"6","location":"assets","locale":"","width":1193,"height":607}},"screenshots":{"1":"The Code Snippets admin list with the <strong>ID<\/strong>, <strong>Shortcode<\/strong> and <strong>Copies<\/strong> columns.","2":"Editing a snippet \u2014 the CodeMirror editor keeps indentation and syntax intact.","3":"The Settings page (default label, default class, tooltip text, guest-access toggle).","4":"The <strong>Clipboard Snippet<\/strong> Gutenberg block with its sidebar controls.","5":"A copy button on the frontend, with the success tooltip.","6":"Inline mode rendering the snippet as a styled <code>&lt;pre&gt;&lt;code&gt;<\/code> block."}},"plugin_section":[],"plugin_tags":[17897,18607,2738,249120,151844],"plugin_category":[],"plugin_contributors":[187022],"plugin_business_model":[],"class_list":["post-252206","plugin","type-plugin","status-publish","hentry","plugin_tags-clipboard","plugin_tags-code-snippet","plugin_tags-copy","plugin_tags-copy-shortcode","plugin_tags-gutenberg-block","plugin_contributors-webcodingplace","plugin_committers-webcodingplace"],"banners":{"banner":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/banner-772x250.jpg?rev=3546975","banner_2x":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/banner-1544x500.jpg?rev=3546975","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/icon-128x128.png?rev=3536562","icon_2x":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/icon-256x256.png?rev=3536562","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-1.jpg?rev=3536562","caption":"The Code Snippets admin list with the <strong>ID<\/strong>, <strong>Shortcode<\/strong> and <strong>Copies<\/strong> columns."},{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-2.jpg?rev=3536562","caption":"Editing a snippet \u2014 the CodeMirror editor keeps indentation and syntax intact."},{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-3.jpg?rev=3536562","caption":"The Settings page (default label, default class, tooltip text, guest-access toggle)."},{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-4.jpg?rev=3536562","caption":"The <strong>Clipboard Snippet<\/strong> Gutenberg block with its sidebar controls."},{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-5.jpg?rev=3536562","caption":"A copy button on the frontend, with the success tooltip."},{"src":"https:\/\/ps.w.org\/clipboard-snippet-copier\/assets\/screenshot-6.jpg?rev=3536562","caption":"Inline mode rendering the snippet as a styled <code>&lt;pre&gt;&lt;code&gt;<\/code> block."}],"raw_content":"<!--section=description-->\n<p><strong>Clipboard Snippet Copier<\/strong> 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.<\/p>\n\n<p>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.<\/p>\n\n<h4>Why use it?<\/h4>\n\n<ul>\n<li><strong>Sell or showcase shortcodes<\/strong> \u2014 give buyers a \"Copy Demo\" button without exposing messy markup.<\/li>\n<li><strong>Document your code<\/strong> \u2014 share PHP \/ JS \/ CSS examples on tutorial pages with a proper copy button.<\/li>\n<li><strong>Reduce support tickets<\/strong> \u2014 eliminate \"the shortcode didn't work\" issues caused by smart quotes, missing brackets, or whitespace mangling.<\/li>\n<li><strong>Track engagement<\/strong> \u2014 built-in per-snippet copy counter shows what your audience actually uses.<\/li>\n<\/ul>\n\n<h4>Key features<\/h4>\n\n<ul>\n<li>\ud83d\udccb One-click copy to clipboard with success\/failure tooltip.<\/li>\n<li>\ud83d\udd12 <strong>Hidden mode<\/strong> \u2014 the snippet is stored in the admin and fetched via AJAX only when copied (never rendered in the HTML).<\/li>\n<li>\ud83d\udc41\ufe0f <strong>Inline mode<\/strong> \u2014 render the snippet visibly as a <code>&lt;pre&gt;&lt;code&gt;<\/code> block with a copy button on top.<\/li>\n<li>\ud83e\uddf1 <strong>Gutenberg block<\/strong> with sidebar controls (snippet ID, label, inline toggle, language hint).<\/li>\n<li>\ud83d\udd22 <strong>Shortcode<\/strong> for the Classic Editor, WPBakery, Elementor and any other builder.<\/li>\n<li>\ud83e\uddee <strong>Copy counter<\/strong> \u2014 sortable \"Copies\" column on the admin list, so you can see what's popular.<\/li>\n<li>\u2699\ufe0f <strong>Settings page<\/strong> \u2014 default label, default CSS class, tooltip text, guest-access toggle.<\/li>\n<li>\ud83d\udcdd <strong>CodeMirror editor<\/strong> on the snippet edit screen \u2014 keeps your indentation and angle brackets intact.<\/li>\n<li>\u26a1 Tiny footprint \u2014 no jQuery dependency on the frontend, no external libraries.<\/li>\n<li>\ud83c\udf10 Translation-ready.<\/li>\n<\/ul>\n\n<h4>How it works<\/h4>\n\n<ol>\n<li>You add a snippet in <strong>Code Snippets \u2192 Add New<\/strong> and note its ID.<\/li>\n<li>You drop the <strong>Clipboard Snippet<\/strong> block (or the <code>[clipsnco_code_copy_btn]<\/code> shortcode) onto any page.<\/li>\n<li>When a visitor clicks the button, the snippet is fetched over AJAX and written to their clipboard \u2014 without ever appearing in the page source (unless you turned on inline mode).<\/li>\n<\/ol>\n\n<h3>Usage<\/h3>\n\n<h4>Quick start (shortcode)<\/h4>\n\n<pre><code>[clipsnco_code_copy_btn id=\"123\" label=\"Copy Code\"]\n<\/code><\/pre>\n\n<p>Where <code>123<\/code> is the ID of your snippet (visible in the <strong>Code Snippets<\/strong> admin list).<\/p>\n\n<h4>Shortcode attributes<\/h4>\n\n<ul>\n<li><code>id<\/code> <em>(required, integer)<\/em> \u2014 the snippet ID.<\/li>\n<li><code>label<\/code> <em>(optional, string)<\/em> \u2014 button text. Defaults to the value set on the Settings page.<\/li>\n<li><code>class<\/code> <em>(optional, string)<\/em> \u2014 extra CSS classes added to the button.<\/li>\n<li><code>inline<\/code> <em>(optional, \"yes\" \/ \"no\")<\/em> \u2014 when <code>yes<\/code>, the snippet is rendered as a <code>&lt;pre&gt;&lt;code&gt;<\/code> block with a copy button on top. Default <code>no<\/code>.<\/li>\n<li><code>language<\/code> <em>(optional, string)<\/em> \u2014 e.g. <code>php<\/code>, <code>js<\/code>, <code>css<\/code>. Adds a <code>language-xxx<\/code> class on the <code>&lt;code&gt;<\/code> element so syntax-highlighter libraries (Prism.js, highlight.js) can colourise it.<\/li>\n<\/ul>\n\n<p>Examples:<\/p>\n\n<ul>\n<li>Hidden snippet, custom label: <code>[clipsnco_code_copy_btn id=\"42\" label=\"Copy shortcode\"]<\/code><\/li>\n<li>Inline display with PHP highlighting: <code>[clipsnco_code_copy_btn id=\"42\" inline=\"yes\" language=\"php\"]<\/code><\/li>\n<li>Extra CSS class for theme styling: <code>[clipsnco_code_copy_btn id=\"42\" class=\"my-cta-btn\"]<\/code><\/li>\n<\/ul>\n\n<h4>Gutenberg block<\/h4>\n\n<p>In the block editor, search for <strong>\"Clipboard Snippet\"<\/strong> and insert it. The sidebar lets you set:<\/p>\n\n<ul>\n<li><strong>Snippet ID<\/strong> \u2014 the post ID of the snippet to copy.<\/li>\n<li><strong>Button label<\/strong> \u2014 overrides the default label.<\/li>\n<li><strong>Show code inline<\/strong> \u2014 toggle hidden vs inline display.<\/li>\n<li><strong>Language hint<\/strong> \u2014 optional syntax-highlighter class.<\/li>\n<\/ul>\n\n<p>The block is server-rendered, so you can switch between block and shortcode usage freely.<\/p>\n\n<h4>Alternative button markup<\/h4>\n\n<p>If your page builder won't let you drop a <code>&lt;button&gt;<\/code> element, you can put any element on the page with the data attribute or the helper class \u2014 the plugin's frontend script picks it up automatically:<\/p>\n\n<pre><code>&lt;a href=\"#\" class=\"wcp-code-copy-btn\" data-codecopy-id=\"123\"&gt;Copy&lt;\/a&gt;\n<\/code><\/pre>\n\n<p>\u2026or, when even attributes aren't allowed, use the class-only form:<\/p>\n\n<pre><code>&lt;span class=\"wcp-code-copy-btn data-codecopy-id-123\"&gt;Copy&lt;\/span&gt;\n<\/code><\/pre>\n\n<h4>Settings<\/h4>\n\n<p><strong>Code Snippets \u2192 Settings<\/strong> lets you configure:<\/p>\n\n<ul>\n<li>Default button label<\/li>\n<li>Default CSS class applied to every button<\/li>\n<li>Tooltip text shown on copy success \/ failure<\/li>\n<li>Whether non-logged-in visitors are allowed to copy snippets<\/li>\n<\/ul>\n\n<h4>Copy counter<\/h4>\n\n<p>Every successful copy by a non-editor user bumps a <code>_clipsnco_copy_count<\/code> post meta value. The count is shown in the <strong>Copies<\/strong> column on the snippets admin list. Click the column header to sort by most-copied.<\/p>\n\n<h4>Styling<\/h4>\n\n<p>The button receives the class <code>wcp-code-copy-btn<\/code> plus anything you add via the shortcode\/block <code>class<\/code> attribute. The inline-mode wrapper uses these classes (override them from your theme):<\/p>\n\n<ul>\n<li><code>.clipsnco-inline-wrap<\/code> \u2014 outer container<\/li>\n<li><code>.clipsnco-inline-toolbar<\/code> \u2014 top bar containing the copy button<\/li>\n<li><code>.clipsnco-pre<\/code> \u2014 the <code>&lt;pre&gt;<\/code> element<\/li>\n<li><code>.clipsnco-code<\/code> \u2014 the <code>&lt;code&gt;<\/code> element (also gets <code>language-xxx<\/code> when set)<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to <code>\/wp-content\/plugins\/clipboard-snippet-copier<\/code>, or install it directly from the WordPress.org repository.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> screen.<\/li>\n<li>Go to <strong>Code Snippets \u2192 Add New<\/strong> to create your first snippet.<\/li>\n<li>Insert the <strong>Clipboard Snippet<\/strong> block on any page, or paste the shortcode below.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"can%20i%20use%20multiple%20buttons%20on%20the%20same%20page%3F\"><h3>Can I use multiple buttons on the same page?<\/h3><\/dt>\n<dd><p>Yes. Drop as many blocks\/shortcodes as you like \u2014 each one copies its own snippet.<\/p><\/dd>\n<dt id=\"will%20the%20snippet%20appear%20in%20the%20page%20source%3F\"><h3>Will the snippet appear in the page source?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20page%20builders%20like%20wpbakery%20or%20elementor%3F\"><h3>Does it work with page builders like WPBakery or Elementor?<\/h3><\/dt>\n<dd><p>Yes. Place the <code>[clipsnco_code_copy_btn]<\/code> shortcode in any text\/HTML widget, content block or builder element.<\/p><\/dd>\n<dt id=\"can%20i%20show%20the%20code%20on%20the%20page%20and%20have%20a%20copy%20button%3F\"><h3>Can I show the code on the page AND have a copy button?<\/h3><\/dt>\n<dd><p>Yes \u2014 that's inline mode. Set <code>inline=\"yes\"<\/code> on the shortcode or flip the <strong>Show code inline<\/strong> toggle on the block.<\/p><\/dd>\n<dt id=\"does%20this%20play%20nicely%20with%20syntax%20highlighters%3F\"><h3>Does this play nicely with syntax highlighters?<\/h3><\/dt>\n<dd><p>Yes. In inline mode, add the <code>language<\/code> attribute (<code>language=\"php\"<\/code>, <code>language=\"js\"<\/code>, \u2026) and the plugin emits a matching <code>language-xxx<\/code> class on the <code>&lt;code&gt;<\/code> element. Prism.js, highlight.js and most other highlighters pick that up automatically.<\/p><\/dd>\n<dt id=\"where%20can%20i%20see%20how%20many%20times%20a%20snippet%20has%20been%20copied%3F\"><h3>Where can I see how many times a snippet has been copied?<\/h3><\/dt>\n<dd><p>Go to <strong>Code Snippets<\/strong> in the admin. The <strong>Copies<\/strong> column shows the running total; click the header to sort.<\/p><\/dd>\n<dt id=\"can%20i%20prevent%20non-logged-in%20visitors%20from%20copying%20snippets%3F\"><h3>Can I prevent non-logged-in visitors from copying snippets?<\/h3><\/dt>\n<dd><p>Yes. <strong>Code Snippets \u2192 Settings \u2192 Allow guests<\/strong> controls this.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20require%20jquery%3F\"><h3>Does the plugin require jQuery?<\/h3><\/dt>\n<dd><p>No. The frontend script uses native <code>fetch<\/code> and the Clipboard API, with an <code>execCommand<\/code> fallback for older\/insecure contexts.<\/p><\/dd>\n<dt id=\"is%20the%20plugin%20translation-ready%3F\"><h3>Is the plugin translation-ready?<\/h3><\/dt>\n<dd><p>Yes \u2014 text domain <code>clipboard-snippet-copier<\/code>, translations loaded from the <code>\/languages<\/code> folder.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4<\/h4>\n\n<ul>\n<li>New: <strong>Gutenberg block<\/strong> \"Clipboard Snippet\" with sidebar controls (id, label, inline toggle, language hint).<\/li>\n<li>New: <strong>Inline mode<\/strong> \u2014 render the snippet visibly as a <code>&lt;pre&gt;&lt;code&gt;<\/code> block with a copy button on top (<code>inline=\"yes\"<\/code>).<\/li>\n<li>New: <strong>Language hint<\/strong> attribute that emits a <code>language-xxx<\/code> class for syntax highlighters.<\/li>\n<li>New: <strong>Settings page<\/strong> \u2014 default label, default CSS class, tooltip text, guest-access toggle.<\/li>\n<li>New: <strong>Copy counter<\/strong> per snippet, shown as a sortable admin column.<\/li>\n<li>New: <strong>CodeMirror editor<\/strong> on the snippet edit screen for proper code formatting.<\/li>\n<li>Improvement: Frontend script no longer depends on jQuery.<\/li>\n<li>Improvement: Centralised <code>CLIPSNCO_VERSION<\/code> constant used across asset enqueues.<\/li>\n<li>Improvement: Translations now properly loaded via <code>load_plugin_textdomain()<\/code>.<\/li>\n<li>Improvement: Escaped admin column output.<\/li>\n<li>Improvement: AJAX response now includes a <code>content<\/code> key (legacy <code>shortcode<\/code> key preserved for backwards compatibility).<\/li>\n<li>Fix: Removed stray <code>console.log<\/code> from the frontend script.<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Fixed: Resource version not set in call to <code>wp_enqueue_style()<\/code>.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Bug fixes.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release of Clipboard Snippet Copier.<\/li>\n<\/ul>","raw_excerpt":"One-click copy-to-clipboard for shortcodes &amp; code snippets. Hide the raw code or show it inline. Works with a shortcode or Gutenberg block.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/252206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=252206"}],"author":[{"embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/webcodingplace"}],"wp:attachment":[{"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=252206"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=252206"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=252206"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=252206"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=252206"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/de-ch.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=252206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}