Plugin Directory

Changeset 3464250


Ignore:
Timestamp:
02/18/2026 11:07:35 AM (25 hours ago)
Author:
kasuga16
Message:

Update to 1.5.0 from 1.4.0

Location:
stick-copy-button-codeblock
Files:
13 added
2 edited

Legend:

Unmodified
Added
Removed
  • stick-copy-button-codeblock/trunk/readme.txt

    r3445344 r3464250  
    66Requires PHP: 7.4
    77Tested up to: 6.9
    8 Stable tag: 1.4.0
     8Stable tag: 1.5.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    165165
    166166== Changelog ==
     167= 1.5.0 =
     168* Load scripts only when code blocks are detected.
     169
    167170= 1.4.0 =
    168171* Added an option to display line numbers.
  • stick-copy-button-codeblock/trunk/stick-copy-button-codeblock.php

    r3414250 r3464250  
    33 * Plugin Name: Sticky Copy Button for Code Blocks
    44 * 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.4.0
     5 * Version: 1.5.0
    66 * Author: Kasuga
    77 * License: GPLv2 or later
     
    235235 */
    236236function kasuga_scbc_enqueue_assets() {
     237    if ( ! is_singular() ) {
     238        return;
     239    }
     240
     241    global $post;
     242    if ( ! $post || ! isset( $post->post_content ) ) {
     243        return;
     244    }
     245
     246    if ( ! has_block( 'core/code', $post ) && strpos( $post->post_content, '<pre' ) === false ) {
     247        return;
     248    }
    237249
    238250    $settings = array(
     
    260272        .code-block-wrapper .line-numbers span {
    261273            display: block !important;
    262             height: 1.5em !important;
    263             line-height: 1.5 !important;
     274            height: 1.5em !important;
     275            line-height: 1.5 !important;
    264276            width: 100%;
    265277        }
    266278        .code-block-wrapper pre {
    267             line-height: 1.5 !important;
     279            line-height: 1.5 !important;
    268280            letter-spacing: 0 !important;
    269281        }
Note: See TracChangeset for help on using the changeset viewer.