PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 5.5.4
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v5.5.4
5.5.4 5.5.3 3.1.0 3.2.0 3.2.1 3.3.0 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.6.0 3.7.0 3.8.0 3.8.1 3.8.2 3.8.3 4.0.0 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 All 79 releases
← All changes | includes/class-shortcode.php +6 -3 5.5.3 → 5.5.4 View file →
@@ -83,10 +83,10 @@
83 83 'target' => '', // CSS selector to copy from (advanced).
84 84 'copy-as' => 'text', // 'text' or 'html' (legacy).
85 85 'copy_as' => '', // Copy as: text, html, text_and_html, image, json, svg.
86 86
87 - // Preset/Style.
88 - 'preset' => 'inline', // 'button', 'icon', 'inline', 'cover'.
87 + // Preset/Style. Empty default so legacy style="button" can map in normalize_legacy_atts().
88 + 'preset' => '', // 'button', 'icon', 'inline', 'cover' (default inline after normalize).
89 89
90 90 // Text.
91 91 'button-text' => '', // Button text (overrides preset default).
92 92 'success-text' => '', // Success message.
@@ -255,9 +255,9 @@
255 255 if ( empty( $atts['tooltip'] ) ) {
256 256 $atts['tooltip'] = __( 'Copy to clipboard', 'ctc' );
257 257 }
258 258
259 - // Preset from legacy style.
259 + // Preset from legacy style (style="button|icon|cover").
260 260 if ( empty( $atts['preset'] ) && ! empty( $atts['style'] ) ) {
261 261 $style_map = [
262 262 'icon' => 'icon',
263 263 'button' => 'button',
@@ -265,8 +265,11 @@
265 265 ];
266 266 if ( isset( $style_map[ $atts['style'] ] ) ) {
267 267 $atts['preset'] = $style_map[ $atts['style'] ];
268 268 }
269 + }
270 + if ( empty( $atts['preset'] ) ) {
271 + $atts['preset'] = 'inline';
269 272 }
270 273
271 274 // Button text.
272 275 if ( empty( $atts['button-text'] ) ) {