PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.1.91
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.1.91
2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 2.7.1 All 27 releases
insert-php / admin / activation.php

activation.php in Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts 2.1.91, at admin/activation.php

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class of activation/deactivation of the plugin. Must be registered in file includes/class.plugin.php
4 *
5 * @author Webcraftic <wordpress.webraftic@gmail.com>
6 * @copyright (c) 02.12.2018, Webcraftic
7 * @see Wbcr_Factory410_Activator
8 *
9 * @version 1.0.1
10 */
11
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 class WINP_Activation extends Wbcr_Factory410_Activator {
18
19 /**
20 * Method is executed during the activation of the plugin.
21 *
22 * @since 1.0.0
23 */
24 public function activate() {
25
26 // Write information about the first activation of plugin
27 if ( ! get_option( $this->plugin->getOptionName( 'first_activation' ) ) ) {
28 update_option( $this->plugin->getOptionName( 'first_activation' ), array(
29 'version' => $this->plugin->getPluginVersion(),
30 'timestamp' => time()
31 ) );
32 }
33
34 // Create a demo snippets with examples of use
35 if ( ! get_option( $this->plugin->getOptionName( 'demo_snippets_created' ) ) ) {
36 WINP_Helper::create_demo_snippets();
37 }
38
39 update_option( $this->plugin->getOptionName( 'what_new_210' ), 1 );
40 }
41
42 /**
43 * The method is executed during the deactivation of the plugin.
44 *
45 * @since 1.0.0
46 */
47 public function deactivate() {
48 // Code to be executed during plugin deactivation
49 }
50 }
51
52
53