{"id":246652,"date":"2025-08-23T03:39:23","date_gmt":"2025-08-23T03:39:23","guid":{"rendered":"https:\/\/ja.wordpress.org\/plugins\/copy-code-button\/"},"modified":"2026-03-20T13:33:53","modified_gmt":"2026-03-20T13:33:53","slug":"stick-copy-button-codeblock","status":"publish","type":"plugin","link":"https:\/\/sna.wordpress.org\/plugins\/stick-copy-button-codeblock\/","author":23346985,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.5.1","stable_tag":"1.5.1","tested":"6.9.4","requires":"5.0","requires_php":"7.4","requires_plugins":null,"header_name":"Sticky Copy Button for Code Blocks","header_author":"Kasuga","header_description":"This plugin adds a convenient copy button to every code block on your blog posts. Customize the button's position, labels, size, and colors from a dedicated settings page to match your site's design.","assets_banners_color":"f6f4ef","last_updated":"2026-03-20 13:33:53","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/kasuga16","header_plugin_uri":"","header_author_uri":"","rating":4,"author_block_rating":0,"active_installs":30,"downloads":697,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"kasuga16","date":"2025-08-24 11:40:00"},"1.0.1":{"tag":"1.0.1","author":"kasuga16","date":"2025-10-01 13:22:36"},"1.1.0":{"tag":"1.1.0","author":"kasuga16","date":"2025-11-16 11:07:29"},"1.2.0":{"tag":"1.2.0","author":"kasuga16","date":"2025-11-25 03:10:28"},"1.4.0":{"tag":"1.4.0","author":"kasuga16","date":"2026-01-23 07:47:56"},"1.5.0":{"tag":"1.5.0","author":"kasuga16","date":"2026-02-18 11:07:35"},"1.5.1":{"tag":"1.5.1","author":"kasuga16","date":"2026-03-20 13:33:53"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":1,"5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3348849,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3348849,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544\u00d7500.png":{"filename":"banner-1544\u00d7500.png","revision":3348849,"resolution":"1544x500","location":"assets","locale":""},"banner-772\u00d7250.png":{"filename":"banner-772\u00d7250.png","revision":3348849,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.1.0","1.2.0","1.4.0","1.5.0","1.5.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3350134,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3350134,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3487221,"resolution":"3","location":"plugin"}},"screenshots":{"1":"Plugin settings screen","2":"Button display in an actual blog post","3":"Line numbers displayed on a code block."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[485,1214,2738,1381,251892],"plugin_category":[],"plugin_contributors":[246687],"plugin_business_model":[],"class_list":["post-246652","plugin","type-plugin","status-publish","hentry","plugin_tags-button","plugin_tags-code","plugin_tags-copy","plugin_tags-easy","plugin_tags-line-numbers","plugin_contributors-kasuga16","plugin_committers-kasuga16"],"banners":{"banner":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/banner-772\u00d7250.png?rev=3348849","banner_2x":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/banner-1544\u00d7500.png?rev=3348849","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/icon-128x128.png?rev=3348849","icon_2x":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/icon-256x256.png?rev=3348849","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/screenshot-1.png?rev=3350134","caption":"Plugin settings screen"},{"src":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/assets\/screenshot-2.png?rev=3350134","caption":"Button display in an actual blog post"},{"src":"https:\/\/ps.w.org\/stick-copy-button-codeblock\/trunk\/screenshot-3.png?rev=3487221","caption":"Line numbers displayed on a code block."}],"raw_content":"<!--section=description-->\n<p><strong>Sticky Copy Button for Code Blocks<\/strong> automatically adds a floating copy button to each <code>&lt;pre&gt;&lt;code&gt;<\/code> block on your website.\nIt provides convenient front-end copying for developers, readers, and tutorial users.<\/p>\n\n<h3>Features<\/h3>\n\n<p>This plugin is light, fast, and highly customizable:<\/p>\n\n<ul>\n<li>Adjustable button position (up\/down and left\/right)<\/li>\n<li>Customizable labels (\u201cCopy\u201d \/ \u201cCopied\u201d)<\/li>\n<li>Adjustable font size<\/li>\n<li>Background color, text color, or transparent mode<\/li>\n<li>Max-height option for large code blocks (with scroll support)<\/li>\n<li><strong>Optional line numbers<\/strong> (simple native implementation)<\/li>\n<li>Custom CSS that is safely sanitized<\/li>\n<\/ul>\n\n<p>No dependencies such as Prism or Highlight.js are required.<\/p>\n\n<h3>Detailed Settings Guide<\/h3>\n\n<p>The following explains <strong>every option<\/strong> in the plugin settings page.<\/p>\n\n\n\n<h3>1. <strong>Button Position<\/strong><\/h3>\n\n<p><strong>Adjust vertical position (top offset in px)<\/strong><br \/>\nMoves the button up or down relative to the top of the code block.\nUse positive or negative values to fine-tune vertical alignment.<\/p>\n\n<p><strong>Adjust horizontal position (right offset in px)<\/strong><br \/>\nMoves the button left or right by adjusting how far it sits from the right edge of the code block.\nUse positive or negative values to fine-tune horizontal alignment.<\/p>\n\n<p>These values help fine-tune button alignment to avoid overlapping with theme elements.<\/p>\n\n\n\n<h3>2. <strong>Button Text and Behavior<\/strong><\/h3>\n\n<p><strong>Copy button label<\/strong><br \/>\nThe label shown normally (default: \u201cCopy\u201d).<\/p>\n\n<p><strong>Label after copying (2 seconds)<\/strong>\nOnce the text is copied, the button temporarily displays this label.\nDefault: \u201cCopied\u201d.<\/p>\n\n\n\n<h3>3. <strong>Button Size<\/strong><\/h3>\n\n<p><strong>Button size (8\u201336 px)<\/strong>\nControls the font size of the button.\nPadding is automatically adjusted based on this value.<\/p>\n\n\n\n<h3>4. <strong>Button Colors<\/strong><\/h3>\n\n<p><strong>Button text color<\/strong>\nHex color of button text.<\/p>\n\n<p><strong>Button background color<\/strong>\nHex background color.\nWhen copying, the plugin automatically swaps the text and background colors for visual feedback.\nHowever, if the background is transparent, only the text color is swapped.<\/p>\n\n<p><strong>Always transparent background<\/strong>\nIf enabled:\n- The button background always becomes transparent.\n- Only text + border remain visible<\/p>\n\n\n\n<h3>5. <strong>Code Block Max Height<\/strong><\/h3>\n\n<p><strong>Code block max height (px)<\/strong>\nSets a maximum height (minimum: 100px).\nContent taller than this becomes scrollable.<\/p>\n\n<p><strong>Enable<\/strong>\nMust be checked for the value to apply.<\/p>\n\n<p>This prevents long code blocks from stretching your page layout.<\/p>\n\n\n\n<h3>6. <strong>Display Line Numbers<\/strong><\/h3>\n\n<p><strong>Display Line Numbers (Enable)<\/strong>\nShows simple line numbers next to each line.\nNotes:\n- Line height is unified for consistency.\n- Theme-specific code styling is preserved.\n- Line wrapping is forcibly disabled.<\/p>\n\n<p>This is a built-in lightweight alternative to syntax-highlighter libraries.<\/p>\n\n\n\n<h3>7. <strong>Custom Styles (CSS)<\/strong><\/h3>\n\n<p>You can add any custom CSS to adjust:<\/p>\n\n<ul>\n<li>Button design<\/li>\n<li>Wrapper layout<\/li>\n<li>Code spacing<\/li>\n<li>Line number appearance<\/li>\n<\/ul>\n\n<p>Usable Selectors (CSS) :<\/p>\n\n<ul>\n<li><strong>.copy-code-btn<\/strong> \u2192 The copy button<\/li>\n<li><strong>.copy-code-btn.copied<\/strong>  \u2192 The button after Copying<\/li>\n<li><strong>.code-block-wrapper<\/strong>  \u2192 Wrapper of the code block (position: relative)<\/li>\n<li><strong>.code-block-wrapper pre<\/strong> \u2192 Inner code text area (the <code>&lt;pre&gt;<\/code> element)<\/li>\n<li><p><strong>.line-numbers<\/strong>  \u2192 The container holding the line numbers<\/p><\/li>\n<li><p>Example:\n&nbsp;<code>.copy-code-btn {<\/code>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>font-family: \"Comic Sans MS\", cursive;<\/code>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>font-weight: 700;<\/code>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>border: none;<\/code>\n&nbsp;<code>}<\/code>\nNote: Do not include any comments.<\/p><\/li>\n<\/ul>\n\n<h3>Donate<\/h3>\n\n<p>If you find this plugin useful and would like to support its development,\nyou can make a voluntary donation via PayPal.<\/p>\n\n<p>Your support helps keep this plugin maintained and improved.\nThank you!<\/p>\n\n<p>PayPal: https:\/\/www.paypal.me\/Kasuga16<\/p>\n\n<!--section=installation-->\n<ol>\n<li><p>Upload via WordPress Dashboard:<\/p>\n\n<p>\u2013 In your WordPress dashboard, go to 'Plugins' \u2192 'Add New'.\n\u2013 Search for \"stick-copy-button-codeblock\" and click 'Install Now'.\n\u2013 Click 'Activate' once the installation is complete.\n\u2013 (Optional) Go to 'Settings' \u2192 'Stick Copy Button' to configure options.<\/p><\/li>\n<li><p>Manual Installation via FTP:<\/p>\n\n<p>\u2013 Download the plugin's zip file and extract it.\n\u2013 Connect to your server via FTP and navigate to the \"wp-content\/plugins\/\" directory.\n\u2013 Upload the extracted \"stick-copy-button-codeblock\" folder to this directory.\n\u2013 Go to 'Plugins' in your WordPress dashboard and activate the plugin.\n\u2013 (Optional) Go to 'Settings' \u2192 'Stick Copy Button' to configure options.<\/p><\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"which%20code%20blocks%20does%20this%20plugin%20support%3F\"><h3>Which code blocks does this plugin support?<\/h3><\/dt>\n<dd><p>It supports only code blocks marked up in the <code>pre &gt; code<\/code> format.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.5.1<\/h4>\n\n<ul>\n<li>Minor fix to the conditional script loading logic introduced in 1.5.0.<\/li>\n<\/ul>\n\n<h4>1.5.0<\/h4>\n\n<ul>\n<li>Load scripts only when code blocks are detected.<\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li>Added an option to display line numbers.<\/li>\n<li>Minor bug fixes.<\/li>\n<li>Updated readme.txt.<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Changed the method for limiting code block height from line count to pixel-based sizing.<\/li>\n<li>Minor bug fixes.<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added support for limiting code block height by line count.<\/li>\n<li>Added a Custom CSS option, allowing users to apply their own CSS to style the copy button or code blocks.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Changed button size settings from a size selector to a numeric input field.<\/li>\n<li>Minor improvements and cleanup.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Minor bug fixes<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<li>Optimized and fixed code for official distribution.<\/li>\n<li>Added internationalization support.<\/li>\n<\/ul>","raw_excerpt":"Adds a floating &quot;Copy&quot; button to every code block, with extensive styling options, optional line numbers, max-height control, and custom CSS support.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/246652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=246652"}],"author":[{"embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kasuga16"}],"wp:attachment":[{"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=246652"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=246652"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=246652"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=246652"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=246652"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sna.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=246652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}