| 1 |
<?php |
| 2 |
/** |
| 3 |
* Fired during plugin activation |
| 4 |
* |
| 5 |
* @package Tableberg |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Tableberg; |
| 9 |
use Tableberg\Utils\Utils; |
| 10 |
|
| 11 |
/** |
| 12 |
* Fired during plugin activation. |
| 13 |
* |
| 14 |
* This class defines all code necessary to run during the plugin's activation. |
| 15 |
* |
| 16 |
* @since 1.0.2 |
| 17 |
* @package Tableberg |
| 18 |
* @author Imtiaz Rayhan <imtiazrayhan@gmail.com> |
| 19 |
*/ |
| 20 |
class Activator { |
| 21 |
|
| 22 |
/** |
| 23 |
* Short Description. (use period) |
| 24 |
* |
| 25 |
* Long Description. |
| 26 |
* |
| 27 |
* @since 1.0.2 |
| 28 |
*/ |
| 29 |
public static function activate() { |
| 30 |
|
| 31 |
set_transient( '_welcome_redirect_tableberg', true, 60 ); |
| 32 |
|
| 33 |
$individual_control = get_option( 'tableberg_individual_control', false ); |
| 34 |
$block_properties = get_option( 'tableberg_block_properties', false ); |
| 35 |
$global_control = get_option( 'tableberg_global_control', false ); |
| 36 |
|
| 37 |
if ( ! $global_control ) { |
| 38 |
update_option( 'tableberg_global_control', Utils::global_control() ); |
| 39 |
} |
| 40 |
if ( ! $individual_control ) { |
| 41 |
update_option( 'tableberg_individual_control', Utils::individual_control() ); |
| 42 |
} |
| 43 |
if ( ! $block_properties ) { |
| 44 |
update_option( 'tableberg_block_properties', Utils::default_block_properties() ); |
| 45 |
} |
| 46 |
|
| 47 |
if ( ! get_option( 'tableberg_version' ) ) { |
| 48 |
add_option( 'tableberg_version', Constants::plugin_version() ); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
} |
| 53 |
|