[WordPress] 外掛分享: Oriole One Instant Copy

首頁外掛目錄 › Oriole One Instant Copy
全新外掛
安裝啟用
尚無評分
12 天前
最後更新
問題解決
WordPress 5.8+ PHP 7.4+ v1.0.0 上架:2026-06-02

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Oriole One Instant Copy」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Oriole One Instant Copy enhances the standard WordPress Gutenberg Code block (core/code) by injecting a small, accessible “Copy” button into the top-right corner of every code block on your site — automatically, on every existing and future post.
No shortcodes. No block-editor changes. No database modifications. Pure progressive enhancement.
How it works
The plugin uses vanilla JavaScript to detect every pre.wp-block-code element after the page loads and appends a lightweight Copy button. When clicked, the button copies the code text to the system clipboard using the modern navigator.clipboard API, with a document.execCommand fallback for older browsers.
The stored post content is never touched. If you deactivate or uninstall the plugin, your posts are exactly as they were before.
Key Features

Automatic — works on all existing and future posts without any editor involvement.
Lightweight — total asset footprint under 5 KB combined (CSS + JS). Zero dependencies.
Accessible — keyboard navigable, aria-label support, focus-visible outlines, screen-reader text, reduced-motion aware, high-contrast mode support.
Smart enqueueing — assets are loaded only on pages that actually contain a Gutenberg code block, not on every page of your site.
Clipboard API with fallback — uses navigator.clipboard.writeText() on secure contexts and falls back to execCommand('copy') for legacy environments.
Duplicate-proof — skips any code block that already has a copy button to avoid conflicts with other plugins.
Theme-safe — uses currentColor and semi-transparent backgrounds; works with light and dark themes without hardcoding colours.
No jQuery — vanilla JavaScript only.
No tracking, no telemetry, no external requests — 100% self-hosted.
Multisite compatible.

Settings
Find the settings under Settings → Oriole One Instant Copy:

Enable / Disable the button globally.
Button text — customise the label shown on the button (default: “Copy”).
Success text — customise the label shown after copying (default: “Copied!”).
Position — Top Right (additional positions planned for v2).

Developer Notes
All settings use the WordPress Settings API with sanitize_callback and proper nonce handling via settings_fields(). No custom REST endpoints, no Gutenberg/React dependencies, no build tools required.
The plugin defines the following PHP constant and classes:

ORIOLE_OIC_VERSION — current plugin version string.
Oriole_OIC_Plugin — main bootstrap class (singleton).
Oriole_OIC_Settings — settings page and storage class.

Option stored in wp_options: oriole_oic_settings (autoloaded, single serialised array).

延伸相關外掛

文章
Filter
Apply Filters
Mastodon