PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.1
2.13.0 2.13.1 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 All 80 releases
← All changes | includes/installer.php +50 -0 2.7.62.13.1 View file →
@@ -1,0 +1,50 @@
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 + 'link-guard' => false,
37 + ];
38 + add_option( ABLOCKS_ADDONS_SETTINGS_NAME, wp_json_encode( $addons_default_settings ) );
39 + }
40 + if ( ! get_option( 'ablocks_first_install_time' ) ) {
41 + add_option( 'ablocks_first_install_time', Helper::get_time(), '', false );
42 + }
43 + add_option( 'ablocks_need_activation_redirect', true );
44 + }
45 + public function create_pages() {
46 + \ABlocks\CreatePage\ForgetPasswordPage::init();
47 + \ABlocks\CreatePage\LoginPage::init();
48 + \ABlocks\CreatePage\RegisterPage::init();
49 + }
50 +}