Changeset 3465464
- Timestamp:
- 02/20/2026 01:39:14 AM (6 weeks ago)
- Location:
- stick-copy-button-codeblock
- Files:
-
- 13 added
- 2 edited
-
tags/1.5.1 (added)
-
tags/1.5.1/assets (added)
-
tags/1.5.1/assets/scbc-script.js (added)
-
tags/1.5.1/assets/scbc-style.css (added)
-
tags/1.5.1/languages (added)
-
tags/1.5.1/languages/stick-copy-button-codeblock-ja.mo (added)
-
tags/1.5.1/languages/stick-copy-button-codeblock-ja.po (added)
-
tags/1.5.1/languages/stick-copy-button-codeblock.pot (added)
-
tags/1.5.1/readme.txt (added)
-
tags/1.5.1/screenshot-1.png (added)
-
tags/1.5.1/screenshot-2.png (added)
-
tags/1.5.1/screenshot-3.png (added)
-
tags/1.5.1/stick-copy-button-codeblock.php (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/stick-copy-button-codeblock.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stick-copy-button-codeblock/trunk/readme.txt
r3464250 r3465464 165 165 166 166 == Changelog == 167 = 1.5.1 = 168 * Minor fix to the conditional script loading logic introduced in 1.5.0. 169 167 170 = 1.5.0 = 168 171 * Load scripts only when code blocks are detected. -
stick-copy-button-codeblock/trunk/stick-copy-button-codeblock.php
r3464250 r3465464 3 3 * Plugin Name: Sticky Copy Button for Code Blocks 4 4 * 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. Optional line numbers can be displayed. 5 * Version: 1.5. 05 * Version: 1.5.1 6 6 * Author: Kasuga 7 7 * License: GPLv2 or later … … 235 235 */ 236 236 function kasuga_scbc_enqueue_assets() { 237 if ( is_admin() || is_feed() ) { 238 return; 239 } 240 237 241 if ( ! is_singular() ) { 238 242 return; … … 244 248 } 245 249 246 if ( ! has_block( 'core/code', $post ) && strpos( $post->post_content, '<pre' ) === false ) { 250 $should_enqueue = false; 251 252 if ( has_block( 'core/code', $post ) || has_block( 'core/preformatted', $post ) ) { 253 $should_enqueue = true; 254 } 255 256 $content = $post->post_content; 257 if ( ! $should_enqueue && ( strpos( $content, '<pre' ) !== false || strpos( $content, '<code' ) !== false ) ) { 258 $should_enqueue = true; 259 } 260 261 if ( ! $should_enqueue && has_block( 'core/block', $post ) ) { 262 $should_enqueue = true; 263 } 264 265 if ( ! $should_enqueue ) { 247 266 return; 248 267 }
Note: See TracChangeset
for help on using the changeset viewer.