PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / trunk
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder vtrunk
2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 All 78 releases
ablocks / includes / installer.php

installer.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder trunk, at includes/installer.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ABlocks;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 use ABlocks\Admin\Settings;
9
10 class Installer {
11
12 public $ablocks_version;
13 public static function init() {
14 $self = new self();
15 $self->ablocks_version = get_option( 'ablocks_version' );
16 Database::create_initial_custom_table();
17 $self->save_main_settings();
18 // Save option table data
19 $self->save_option();
20 // create pages
21 if ( ! $self->ablocks_version ) {
22 $self->create_pages();
23 }
24 }
25 public function save_main_settings() {
26 Settings::save_settings();
27 }
28 public function save_option() {
29 if ( ! $this->ablocks_version ) {
30 add_option( 'ablocks_version', ABLOCKS_VERSION );
31 add_option( 'ablocks_fonts', '{}' );
32 // Save Default activated addon
33 $addons_default_settings = [
34 'theme-builder' => false,
35 'cookie-consent' => false
36 ];
37 add_option( ABLOCKS_ADDONS_SETTINGS_NAME, wp_json_encode( $addons_default_settings ) );
38 }
39 if ( ! get_option( 'ablocks_first_install_time' ) ) {
40 add_option( 'ablocks_first_install_time', Helper::get_time(), '', false );
41 }
42 add_option( 'ablocks_need_activation_redirect', true );
43 }
44 public function create_pages() {
45 \ABlocks\CreatePage\ForgetPasswordPage::init();
46 \ABlocks\CreatePage\LoginPage::init();
47 \ABlocks\CreatePage\RegisterPage::init();
48 }
49 }
50