PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 4.0.3
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v4.0.3
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
copy-the-code / classes / class-copy-the-code-update.php

class-copy-the-code-update.php in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 4.0.3, at classes/class-copy-the-code-update.php

86 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Update
4 *
5 * @package Copy the Code
6 * @since 2.0.0
7 */
8
9 if ( ! class_exists( 'Copy_The_Code_Update' ) ) :
10
11 /**
12 * Copy The Code Update
13 *
14 * @since 2.0.0
15 */
16 class Copy_The_Code_Update {
17
18 /**
19 * Instance
20 *
21 * @var object Class object.
22 * @access private
23 * @since 2.0.0
24 */
25 private static $instance;
26
27 /**
28 * Initiator
29 *
30 * @since 2.0.0
31 * @return object initialized object of class.
32 */
33 public static function get_instance() {
34 if ( ! isset( self::$instance ) ) {
35 self::$instance = new self();
36 }
37 return self::$instance;
38 }
39
40 /**
41 * Constructor
42 *
43 * @since 2.0.0
44 */
45 public function __construct() {
46 add_action( 'admin_init', __CLASS__ . '::init' );
47 }
48
49 /**
50 * Init
51 *
52 * @since 2.0.0
53 * @return void
54 */
55 public static function init() {
56
57 do_action( 'copy_the_code_update_before' );
58
59 // Get auto saved version number.
60 $saved_version = get_option( 'copy-the-code-auto-version', false );
61
62 // Update auto saved version number.
63 if ( ! $saved_version ) {
64 update_option( 'copy-the-code-auto-version', COPY_THE_CODE_VER );
65 }
66
67 // If equals then return.
68 if ( version_compare( $saved_version, COPY_THE_CODE_VER, '=' ) ) {
69 return;
70 }
71
72 // Update auto saved version number.
73 update_option( 'copy-the-code-auto-version', COPY_THE_CODE_VER );
74
75 do_action( 'copy_the_code_update_after' );
76 }
77
78 }
79
80 /**
81 * Kicking this off by calling 'get_instance()' method
82 */
83 Copy_The_Code_Update::get_instance();
84
85 endif;
86