PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 2.2.2
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v2.2.2
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 4.1.1 All 78 releases
← All changes | classes/class-copy-the-code-update.php +35 -0 3.8.22.2.2 View file →
@@ -68,12 +68,47 @@
68 68 if ( version_compare( $saved_version, COPY_THE_CODE_VER, '=' ) ) {
69 69 return;
70 70 }
71 71
72 + // Update to older version than 1.0.1 version.
73 + if ( version_compare( $saved_version, '2.0.0', '<' ) ) {
74 + self::v_2_0_0();
75 + }
76 +
72 77 // Update auto saved version number.
73 78 update_option( 'copy-the-code-auto-version', COPY_THE_CODE_VER );
74 79
75 80 do_action( 'copy_the_code_update_after' );
81 + }
82 +
83 + /**
84 + * Create a default
85 + *
86 + * @since 2.0.0
87 + * @return void
88 + */
89 + public static function v_2_0_0() {
90 +
91 + $defaults = array(
92 + 'selector' => 'pre',
93 + 'style' => 'button',
94 + 'button-text' => 'Copy',
95 + 'button-title' => 'Copy',
96 + 'button-copy-text' => 'Copied!',
97 + 'button-position' => 'inside',
98 + );
99 +
100 + $stored_data = Copy_The_Code_Page::get_instance()->get_page_settings();
101 + $data = wp_parse_args( $stored_data, $defaults );
102 +
103 + $args = array(
104 + 'post_type' => 'copy-to-clipboard',
105 + 'post_status' => 'publish',
106 + 'post_title' => $data['selector'],
107 + 'meta_input' => $data,
108 + );
109 +
110 + wp_insert_post( $args );
76 111 }
77 112
78 113 }
79 114