Version Description
Download this release
Release Info
Developer | creativethemeshq |
Plugin | Blocksy Companion |
Version | 1.8.9.6 |
Comparing to | |
See all releases |
Code changes from version 1.8.9.5 to 1.8.9.6
- blocksy-companion.php +1 -1
- framework/autoload.php +1 -0
- framework/cli.php +107 -14
- framework/dashboard.php +1 -1
- framework/extensions/cookies-consent/static/bundle/main.min.css +1 -1
- framework/extensions/newsletter-subscribe/static/bundle/main.min.css +1 -1
- framework/extensions/product-reviews/static/bundle/main-admin.min.css +1 -1
- framework/extensions/product-reviews/static/bundle/main.min.css +1 -1
- framework/extensions/trending/customizer.php +1 -2
- framework/extensions/trending/static/bundle/main.min.css +1 -1
- framework/extensions/widgets/static/bundle/main.min.css +1 -1
- framework/features/account-auth.php +205 -0
- framework/features/demo-install/content-eraser.php +51 -28
- framework/features/demo-install/install-finish.php +31 -14
- framework/features/demo-install/required-plugins.php +1 -0
- framework/features/header.php +15 -1
- framework/features/header/account-modal.php +3 -2
- framework/features/header/items/account/dynamic-styles.php +81 -34
- framework/features/header/items/account/options.php +117 -49
- framework/features/header/items/account/sync.js +38 -2
- framework/features/header/modal/login.php +40 -19
- framework/features/header/modal/lostpassword.php +2 -0
- framework/features/header/modal/register.php +71 -14
- framework/helpers/blocksy-integration.php +1 -1
- framework/theme-integration.php +2 -73
- freemius/includes/class-freemius.php +202 -25364
blocksy-companion.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Â
/*
|
4 |
Â
Plugin Name: Blocksy Companion
|
5 |
Â
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
6 |
-
Version: 1.8.9.
|
7 |
Â
Author: CreativeThemes
|
8 |
Â
Author URI: https://creativethemes.com
|
9 |
Â
Text Domain: blocksy-companion
|
3 |
Â
/*
|
4 |
Â
Plugin Name: Blocksy Companion
|
5 |
Â
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
6 |
+
Version: 1.8.9.6
|
7 |
Â
Author: CreativeThemes
|
8 |
Â
Author URI: https://creativethemes.com
|
9 |
Â
Text Domain: blocksy-companion
|
framework/autoload.php
CHANGED
@@ -26,6 +26,7 @@ class Autoloader {
|
|
26 |
Â
'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
|
27 |
Â
'Dashboard' => 'framework/dashboard.php',
|
28 |
Â
'ThemeIntegration' => 'framework/theme-integration.php',
|
Â
|
|
29 |
Â
'CacheResetManager' => 'framework/cache-reset-manager.php',
|
30 |
Â
|
31 |
Â
'GoogleAnalytics' => 'framework/features/google-analytics.php',
|
26 |
Â
'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
|
27 |
Â
'Dashboard' => 'framework/dashboard.php',
|
28 |
Â
'ThemeIntegration' => 'framework/theme-integration.php',
|
29 |
+
'AccountAuth' => 'framework/features/account-auth.php',
|
30 |
Â
'CacheResetManager' => 'framework/cache-reset-manager.php',
|
31 |
Â
|
32 |
Â
'GoogleAnalytics' => 'framework/features/google-analytics.php',
|
framework/cli.php
CHANGED
@@ -2,22 +2,17 @@
|
|
2 |
Â
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
5 |
Â
class Cli {
|
6 |
Â
public function __construct() {
|
7 |
-
\WP_CLI::add_command('blocksy demo plugins', function ($args) {
|
8 |
-
$plugins = [
|
9 |
-
'coblocks',
|
10 |
-
'elementor',
|
11 |
-
'contact-form-7',
|
12 |
-
'woocommerce'
|
13 |
-
];
|
14 |
-
|
15 |
-
foreach ($plugins as $plugin) {
|
16 |
-
\WP_CLI::runcommand('plugin install ' . $plugin, [] );
|
17 |
-
\WP_CLI::runcommand('plugin activate ' . $plugin, [] );
|
18 |
-
}
|
19 |
-
});
|
20 |
-
|
21 |
Â
\WP_CLI::add_command('blocksy demo options', function ($args) {
|
22 |
Â
$options = new DemoInstallOptionsInstaller([
|
23 |
Â
'has_streaming' => false,
|
@@ -77,6 +72,104 @@ class Cli {
|
|
77 |
Â
|
78 |
Â
$options->import();
|
79 |
Â
});
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
80 |
Â
}
|
81 |
Â
}
|
82 |
Â
|
2 |
Â
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
5 |
+
add_action('blocksy:customizer:load:before', function () {
|
6 |
+
$_REQUEST['wp_customize'] = 'on';
|
7 |
+
_wp_customize_include();
|
8 |
+
|
9 |
+
global $wp_customize;
|
10 |
+
|
11 |
+
$wp_customize->wp_loaded();
|
12 |
+
});
|
13 |
+
|
14 |
Â
class Cli {
|
15 |
Â
public function __construct() {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
16 |
Â
\WP_CLI::add_command('blocksy demo options', function ($args) {
|
17 |
Â
$options = new DemoInstallOptionsInstaller([
|
18 |
Â
'has_streaming' => false,
|
72 |
Â
|
73 |
Â
$options->import();
|
74 |
Â
});
|
75 |
+
|
76 |
+
\WP_CLI::add_command('blocksy demo import:start', function ($cli_argv) {
|
77 |
+
$args = $this->get_demo_args($cli_argv);
|
78 |
+
|
79 |
+
Plugin::instance()->demo->set_current_demo(
|
80 |
+
$args['demo'] . ':' . $args['builder']
|
81 |
+
);
|
82 |
+
|
83 |
+
$demo_data = Plugin::instance()->demo->fetch_single_demo([
|
84 |
+
'demo' => $args['demo'],
|
85 |
+
'builder' => $args['builder']
|
86 |
+
]);
|
87 |
+
|
88 |
+
print_r($demo_data);
|
89 |
+
});
|
90 |
+
|
91 |
+
\WP_CLI::add_command('blocksy demo import:plugins', function ($cli_argv) {
|
92 |
+
$args = $this->get_demo_args($cli_argv);
|
93 |
+
|
94 |
+
$demo_data = Plugin::instance()->demo->fetch_single_demo([
|
95 |
+
'demo' => $args['demo'],
|
96 |
+
'builder' => $args['builder']
|
97 |
+
]);
|
98 |
+
|
99 |
+
$plugins = new DemoInstallPluginsInstaller([
|
100 |
+
'has_streaming' => false,
|
101 |
+
'plugins' => implode(':', $demo_data['plugins'])
|
102 |
+
]);
|
103 |
+
|
104 |
+
$plugins->import();
|
105 |
+
});
|
106 |
+
|
107 |
+
\WP_CLI::add_command('blocksy demo import:options', function ($cli_argv) {
|
108 |
+
$args = $this->get_demo_args($cli_argv);
|
109 |
+
|
110 |
+
$options = new DemoInstallOptionsInstaller([
|
111 |
+
'has_streaming' => false,
|
112 |
+
'demo_name' => $args['demo'] . ':' . $args['builder']
|
113 |
+
]);
|
114 |
+
|
115 |
+
$options->import();
|
116 |
+
});
|
117 |
+
|
118 |
+
\WP_CLI::add_command('blocksy demo import:widgets', function ($cli_argv) {
|
119 |
+
$args = $this->get_demo_args($cli_argv);
|
120 |
+
|
121 |
+
$widgets = new DemoInstallWidgetsInstaller([
|
122 |
+
'has_streaming' => false,
|
123 |
+
'demo_name' => $args['demo'] . ':' . $args['builder']
|
124 |
+
]);
|
125 |
+
|
126 |
+
$widgets->import();
|
127 |
+
});
|
128 |
+
|
129 |
+
\WP_CLI::add_command('blocksy demo import:content', function ($cli_argv) {
|
130 |
+
$args = $this->get_demo_args($cli_argv);
|
131 |
+
|
132 |
+
$content = new DemoInstallContentInstaller([
|
133 |
+
'has_streaming' => false,
|
134 |
+
'demo_name' => $args['demo'] . ':' . $args['builder']
|
135 |
+
]);
|
136 |
+
|
137 |
+
$content->import();
|
138 |
+
});
|
139 |
+
|
140 |
+
\WP_CLI::add_command('blocksy demo clean', function ($cli_argv) {
|
141 |
+
update_option('blocksy_ext_demos_current_demo', null);
|
142 |
+
|
143 |
+
$eraser = new DemoInstallContentEraser([
|
144 |
+
'has_streaming' => false
|
145 |
+
]);
|
146 |
+
|
147 |
+
$eraser->import();
|
148 |
+
});
|
149 |
+
|
150 |
+
\WP_CLI::add_command('blocksy demo import:finish', function ($args) {
|
151 |
+
$finish = new DemoInstallFinalActions([
|
152 |
+
'has_streaming' => false
|
153 |
+
]);
|
154 |
+
|
155 |
+
$finish->import();
|
156 |
+
});
|
157 |
+
}
|
158 |
+
|
159 |
+
private function get_demo_args($cli_argv) {
|
160 |
+
if (empty($cli_argv)) {
|
161 |
+
echo 'Please provide demo name.';
|
162 |
+
exit;
|
163 |
+
}
|
164 |
+
|
165 |
+
if (! isset($cli_argv[1])) {
|
166 |
+
$cli_argv[1] = '';
|
167 |
+
}
|
168 |
+
|
169 |
+
return [
|
170 |
+
'demo' => $cli_argv[0],
|
171 |
+
'builder' => $cli_argv[1]
|
172 |
+
];
|
173 |
Â
}
|
174 |
Â
}
|
175 |
Â
|
framework/dashboard.php
CHANGED
@@ -105,7 +105,7 @@ class Dashboard {
|
|
105 |
Â
}
|
106 |
Â
|
107 |
Â
$result = [
|
108 |
-
'is_pro' => blc_fs()->
|
109 |
Â
'is_anonymous' => $is_anonymous,
|
110 |
Â
'connect_template' => $connect_template
|
111 |
Â
];
|
105 |
Â
}
|
106 |
Â
|
107 |
Â
$result = [
|
108 |
+
'is_pro' => blc_fs()->can_use_premium_code__premium_only(),
|
109 |
Â
'is_anonymous' => $is_anonymous,
|
110 |
Â
'connect_template' => $connect_template
|
111 |
Â
];
|
framework/extensions/cookies-consent/static/bundle/main.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/extensions/newsletter-subscribe/static/bundle/main.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main-admin.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/extensions/trending/customizer.php
CHANGED
@@ -263,8 +263,7 @@ $options = [
|
|
263 |
Â
],
|
264 |
Â
],
|
265 |
Â
|
266 |
-
blc_fs()->
|
267 |
-
|
268 |
Â
'trending_block_location' => [
|
269 |
Â
'label' => __('Display Location', 'blocksy-companion'),
|
270 |
Â
'type' => 'ct-select',
|
263 |
Â
],
|
264 |
Â
],
|
265 |
Â
|
266 |
+
blc_fs()->can_use_premium_code__premium_only() ? [
|
Â
|
|
267 |
Â
'trending_block_location' => [
|
268 |
Â
'label' => __('Display Location', 'blocksy-companion'),
|
269 |
Â
'type' => 'ct-select',
|
framework/extensions/trending/static/bundle/main.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/extensions/widgets/static/bundle/main.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Â
/**
|
2 |
-
* - v1.8.9.
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
1 |
Â
/**
|
2 |
+
* - v1.8.9.6
|
3 |
Â
*
|
4 |
Â
* Copyright (c) 2021
|
5 |
Â
* Licensed GPLv2+
|
framework/features/account-auth.php
ADDED
@@ -0,0 +1,205 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
class AccountAuth {
|
6 |
+
public function __construct() {
|
7 |
+
add_action(
|
8 |
+
'wp_ajax_blc_implement_user_registration',
|
9 |
+
[$this, 'blc_implement_user_registration']
|
10 |
+
);
|
11 |
+
|
12 |
+
add_action(
|
13 |
+
'wp_ajax_nopriv_blc_implement_user_registration',
|
14 |
+
[$this, 'blc_implement_user_registration']
|
15 |
+
);
|
16 |
+
|
17 |
+
add_action(
|
18 |
+
'wp_ajax_blc_implement_user_lostpassword',
|
19 |
+
[$this, 'blc_implement_user_lostpassword']
|
20 |
+
);
|
21 |
+
|
22 |
+
add_action(
|
23 |
+
'wp_ajax_nopriv_blc_implement_user_lostpassword',
|
24 |
+
[$this, 'blc_implement_user_lostpassword']
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function blc_implement_user_lostpassword() {
|
29 |
+
ob_start();
|
30 |
+
require_once ABSPATH . 'wp-login.php';
|
31 |
+
$res = ob_get_clean();
|
32 |
+
|
33 |
+
$errors = [];
|
34 |
+
$success = false;
|
35 |
+
|
36 |
+
if (class_exists('WC_Shortcode_My_Account')) {
|
37 |
+
$success = \WC_Shortcode_My_Account::retrieve_password();
|
38 |
+
|
39 |
+
if (! $success) {
|
40 |
+
$errors = new \WP_Error();
|
41 |
+
$notices = wc_get_notices();
|
42 |
+
|
43 |
+
if (isset($notices['error'])) {
|
44 |
+
foreach ($notices['error'] as $notice) {
|
45 |
+
$errors->add(
|
46 |
+
'invalidcombo',
|
47 |
+
sprintf(
|
48 |
+
__('<strong>Error</strong>: %s'),
|
49 |
+
$notice['notice']
|
50 |
+
)
|
51 |
+
);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
} else {
|
56 |
+
$errors = retrieve_password();
|
57 |
+
$success = ! is_wp_error($errors);
|
58 |
+
}
|
59 |
+
|
60 |
+
if ($success) {
|
61 |
+
$errors = new \WP_Error();
|
62 |
+
|
63 |
+
$errors->add(
|
64 |
+
'confirm',
|
65 |
+
sprintf(
|
66 |
+
/* translators: %s: Link to the login page. */
|
67 |
+
__(
|
68 |
+
'Check your email for the confirmation link, then visit the <a href="%s">login page</a>.',
|
69 |
+
'blocksy-companion'
|
70 |
+
),
|
71 |
+
wp_login_url()
|
72 |
+
),
|
73 |
+
'message'
|
74 |
+
);
|
75 |
+
|
76 |
+
$redirect_to = admin_url();
|
77 |
+
$errors = apply_filters('wp_login_errors', $errors, $redirect_to);
|
78 |
+
|
79 |
+
login_header(__('Check your email', 'blocksy-companion'), '', $errors);
|
80 |
+
|
81 |
+
wp_die();
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Fires before the lost password form.
|
86 |
+
*
|
87 |
+
* @since 1.5.1
|
88 |
+
* @since 5.1.0 Added the `$errors` parameter.
|
89 |
+
*
|
90 |
+
* @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
|
91 |
+
* credentials. Note that the error object may not contain any errors.
|
92 |
+
*/
|
93 |
+
do_action( 'lost_password', $errors );
|
94 |
+
|
95 |
+
login_header(
|
96 |
+
__( 'Lost Password' ),
|
97 |
+
'<p class="message">' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '</p>',
|
98 |
+
$errors
|
99 |
+
);
|
100 |
+
}
|
101 |
+
|
102 |
+
public function blc_implement_user_registration() {
|
103 |
+
ob_start();
|
104 |
+
require_once ABSPATH . 'wp-login.php';
|
105 |
+
$res = ob_get_clean();
|
106 |
+
|
107 |
+
$_POST['woocommerce-register-nonce'] = '~';
|
108 |
+
|
109 |
+
$users_can_register = get_option('users_can_register');
|
110 |
+
|
111 |
+
if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
|
112 |
+
$users_can_register = true;
|
113 |
+
}
|
114 |
+
|
115 |
+
if (! $users_can_register) {
|
116 |
+
exit;
|
117 |
+
}
|
118 |
+
|
119 |
+
$user_login = '';
|
120 |
+
$user_email = '';
|
121 |
+
$user_pass = '';
|
122 |
+
|
123 |
+
if (isset($_POST['user_login']) && is_string($_POST['user_login'])) {
|
124 |
+
$user_login = wp_unslash($_POST['user_login']);
|
125 |
+
}
|
126 |
+
|
127 |
+
if (isset($_POST['user_email']) && is_string($_POST['user_email'])) {
|
128 |
+
$user_email = wp_unslash($_POST['user_email']);
|
129 |
+
}
|
130 |
+
|
131 |
+
if (isset($_POST['user_pass']) && is_string($_POST['user_pass'])) {
|
132 |
+
$user_pass = wp_unslash($_POST['user_pass']);
|
133 |
+
}
|
134 |
+
|
135 |
+
if (function_exists('wc_create_new_customer')) {
|
136 |
+
$validation_error = new \WP_Error();
|
137 |
+
$validation_error = apply_filters(
|
138 |
+
'woocommerce_process_registration_errors',
|
139 |
+
$validation_error,
|
140 |
+
$user_login,
|
141 |
+
$user_pass,
|
142 |
+
$user_email
|
143 |
+
);
|
144 |
+
|
145 |
+
$errors = wc_create_new_customer(
|
146 |
+
sanitize_email($user_email),
|
147 |
+
wc_clean($user_login),
|
148 |
+
$user_pass
|
149 |
+
);
|
150 |
+
} else {
|
151 |
+
$errors = register_new_user($user_login, $user_email);
|
152 |
+
}
|
153 |
+
|
154 |
+
if (! is_wp_error($errors)) {
|
155 |
+
$errors = new \WP_Error();
|
156 |
+
|
157 |
+
if (function_exists('wc_create_new_customer')) {
|
158 |
+
$error_message = sprintf(
|
159 |
+
__(
|
160 |
+
'Your account was created successfully. Your login details have been sent to your email address. Please visit the <a href="%s">login page</a>.',
|
161 |
+
'blocksy-companion'
|
162 |
+
),
|
163 |
+
wp_login_url()
|
164 |
+
);
|
165 |
+
|
166 |
+
if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) ) {
|
167 |
+
$error_message = sprintf(
|
168 |
+
__(
|
169 |
+
'Your account was created successfully and a password has been sent to your email address. Please visit the <a href="%s">login page</a>.',
|
170 |
+
'blocksy-companion'
|
171 |
+
),
|
172 |
+
wp_login_url()
|
173 |
+
);
|
174 |
+
}
|
175 |
+
|
176 |
+
$errors->add('registered', $error_message, 'message');
|
177 |
+
} else {
|
178 |
+
$errors->add(
|
179 |
+
'registered',
|
180 |
+
sprintf(
|
181 |
+
/* translators: %s: Link to the login page. */
|
182 |
+
__( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
|
183 |
+
wp_login_url()
|
184 |
+
),
|
185 |
+
'message'
|
186 |
+
);
|
187 |
+
}
|
188 |
+
|
189 |
+
$redirect_to = admin_url();
|
190 |
+
$errors = apply_filters('wp_login_errors', $errors, $redirect_to);
|
191 |
+
|
192 |
+
login_header(__('Check your email', 'blocksy-companion'), '', $errors);
|
193 |
+
|
194 |
+
wp_die();
|
195 |
+
}
|
196 |
+
|
197 |
+
login_header(
|
198 |
+
__('Registration Form', 'blocksy-companion'),
|
199 |
+
'<p class="message register">' . __('Register For This Site', 'blocksy-companion') . '</p>',
|
200 |
+
$errors
|
201 |
+
);
|
202 |
+
|
203 |
+
wp_die();
|
204 |
+
}
|
205 |
+
}
|
framework/features/demo-install/content-eraser.php
CHANGED
@@ -3,8 +3,20 @@
|
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
5 |
Â
class DemoInstallContentEraser {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
6 |
Â
public function import() {
|
7 |
-
|
Â
|
|
Â
|
|
8 |
Â
|
9 |
Â
if (! current_user_can('edit_theme_options')) {
|
10 |
Â
/*
|
@@ -24,19 +36,23 @@ class DemoInstallContentEraser {
|
|
24 |
Â
$this->reset_previous_terms();
|
25 |
Â
$this->reset_menus();
|
26 |
Â
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
Â
|
|
31 |
Â
|
32 |
-
|
Â
|
|
33 |
Â
}
|
34 |
Â
|
35 |
Â
private function reset_previous_posts() {
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
Â
|
|
Â
|
|
40 |
Â
|
41 |
Â
global $wpdb;
|
42 |
Â
|
@@ -54,10 +70,12 @@ class DemoInstallContentEraser {
|
|
54 |
Â
}
|
55 |
Â
|
56 |
Â
private function reset_previous_terms() {
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
Â
|
|
Â
|
|
61 |
Â
|
62 |
Â
global $wpdb;
|
63 |
Â
|
@@ -79,10 +97,12 @@ class DemoInstallContentEraser {
|
|
79 |
Â
}
|
80 |
Â
|
81 |
Â
private function erase_default_pages() {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
Â
|
|
Â
|
|
86 |
Â
|
87 |
Â
$sample_page = get_page_by_path('sample-page', OBJECT, 'page');
|
88 |
Â
$hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
|
@@ -99,10 +119,12 @@ class DemoInstallContentEraser {
|
|
99 |
Â
private function reset_customizer() {
|
100 |
Â
global $wp_customize;
|
101 |
Â
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
Â
|
|
Â
|
|
106 |
Â
|
107 |
Â
if (! $wp_customize) {
|
108 |
Â
return;
|
@@ -115,15 +137,17 @@ class DemoInstallContentEraser {
|
|
115 |
Â
continue;
|
116 |
Â
}
|
117 |
Â
|
118 |
-
remove_theme_mod(
|
119 |
Â
}
|
120 |
Â
}
|
121 |
Â
|
122 |
Â
private function reset_widgets_data() {
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
Â
|
|
Â
|
|
127 |
Â
|
128 |
Â
$sidebars_widgets = get_option('sidebars_widgets', array());
|
129 |
Â
|
@@ -176,4 +200,3 @@ class DemoInstallContentEraser {
|
|
176 |
Â
}
|
177 |
Â
}
|
178 |
Â
|
179 |
-
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
5 |
Â
class DemoInstallContentEraser {
|
6 |
+
protected $has_streaming = true;
|
7 |
+
|
8 |
+
public function __construct($args = []) {
|
9 |
+
$args = wp_parse_args($args, [
|
10 |
+
'has_streaming' => true
|
11 |
+
]);
|
12 |
+
|
13 |
+
$this->has_streaming = $args['has_streaming'];
|
14 |
+
}
|
15 |
+
|
16 |
Â
public function import() {
|
17 |
+
if ($this->has_streaming) {
|
18 |
+
Plugin::instance()->demo->start_streaming();
|
19 |
+
}
|
20 |
Â
|
21 |
Â
if (! current_user_can('edit_theme_options')) {
|
22 |
Â
/*
|
36 |
Â
$this->reset_previous_terms();
|
37 |
Â
$this->reset_menus();
|
38 |
Â
|
39 |
+
if ($this->has_streaming) {
|
40 |
+
Plugin::instance()->demo->emit_sse_message([
|
41 |
+
'action' => 'complete',
|
42 |
+
'error' => false,
|
43 |
+
]);
|
44 |
Â
|
45 |
+
exit;
|
46 |
+
}
|
47 |
Â
}
|
48 |
Â
|
49 |
Â
private function reset_previous_posts() {
|
50 |
+
if ($this->has_streaming) {
|
51 |
+
Plugin::instance()->demo->emit_sse_message([
|
52 |
+
'action' => 'erase_previous_posts',
|
53 |
+
'error' => false,
|
54 |
+
]);
|
55 |
+
}
|
56 |
Â
|
57 |
Â
global $wpdb;
|
58 |
Â
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
private function reset_previous_terms() {
|
73 |
+
if ($this->has_streaming) {
|
74 |
+
Plugin::instance()->demo->emit_sse_message([
|
75 |
+
'action' => 'erase_previous_terms',
|
76 |
+
'error' => false,
|
77 |
+
]);
|
78 |
+
}
|
79 |
Â
|
80 |
Â
global $wpdb;
|
81 |
Â
|
97 |
Â
}
|
98 |
Â
|
99 |
Â
private function erase_default_pages() {
|
100 |
+
if ($this->has_streaming) {
|
101 |
+
Plugin::instance()->demo->emit_sse_message([
|
102 |
+
'action' => 'erase_default_pages',
|
103 |
+
'error' => false,
|
104 |
+
]);
|
105 |
+
}
|
106 |
Â
|
107 |
Â
$sample_page = get_page_by_path('sample-page', OBJECT, 'page');
|
108 |
Â
$hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
|
119 |
Â
private function reset_customizer() {
|
120 |
Â
global $wp_customize;
|
121 |
Â
|
122 |
+
if ($this->has_streaming) {
|
123 |
+
Plugin::instance()->demo->emit_sse_message([
|
124 |
+
'action' => 'erase_customizer_settings',
|
125 |
+
'error' => false,
|
126 |
+
]);
|
127 |
+
}
|
128 |
Â
|
129 |
Â
if (! $wp_customize) {
|
130 |
Â
return;
|
137 |
Â
continue;
|
138 |
Â
}
|
139 |
Â
|
140 |
+
remove_theme_mod($single_setting->id);
|
141 |
Â
}
|
142 |
Â
}
|
143 |
Â
|
144 |
Â
private function reset_widgets_data() {
|
145 |
+
if ($this->has_streaming) {
|
146 |
+
Plugin::instance()->demo->emit_sse_message([
|
147 |
+
'action' => 'erase_widgets_data',
|
148 |
+
'error' => false,
|
149 |
+
]);
|
150 |
+
}
|
151 |
Â
|
152 |
Â
$sidebars_widgets = get_option('sidebars_widgets', array());
|
153 |
Â
|
200 |
Â
}
|
201 |
Â
}
|
202 |
Â
|
Â
|
framework/features/demo-install/install-finish.php
CHANGED
@@ -3,15 +3,27 @@
|
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
5 |
Â
class DemoInstallFinalActions {
|
6 |
-
|
7 |
-
Plugin::instance()->demo->start_streaming();
|
8 |
Â
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
15 |
Â
}
|
16 |
Â
|
17 |
Â
$wpforms_settings = get_option('wpforms_settings', []);
|
@@ -20,11 +32,14 @@ class DemoInstallFinalActions {
|
|
20 |
Â
|
21 |
Â
$this->replace_urls();
|
22 |
Â
|
Â
|
|
23 |
Â
do_action('blocksy:dynamic-css:refresh-caches');
|
24 |
Â
Plugin::instance()->cache_manager->run_cache_purge();
|
25 |
Â
|
26 |
Â
if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
|
27 |
-
|
Â
|
|
Â
|
|
28 |
Â
|
29 |
Â
$s = new \WC_REST_System_Status_Tools_V2_Controller();
|
30 |
Â
|
@@ -62,11 +77,13 @@ class DemoInstallFinalActions {
|
|
62 |
Â
}
|
63 |
Â
}
|
64 |
Â
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
Â
|
|
Â
|
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
/**
|
3 |
Â
namespace Blocksy;
|
4 |
Â
|
5 |
Â
class DemoInstallFinalActions {
|
6 |
+
protected $has_streaming = true;
|
Â
|
|
7 |
Â
|
8 |
+
public function __construct($args = []) {
|
9 |
+
$args = wp_parse_args($args, [
|
10 |
+
'has_streaming' => true
|
11 |
+
]);
|
12 |
+
|
13 |
+
$this->has_streaming = $args['has_streaming'];
|
14 |
+
}
|
15 |
+
|
16 |
+
public function import() {
|
17 |
+
if ($this->has_streaming) {
|
18 |
+
Plugin::instance()->demo->start_streaming();
|
19 |
+
|
20 |
+
if (! current_user_can('edit_theme_options')) {
|
21 |
+
Plugin::instance()->demo->emit_sse_message([
|
22 |
+
'action' => 'complete',
|
23 |
+
'error' => false,
|
24 |
+
]);
|
25 |
+
exit;
|
26 |
+
}
|
27 |
Â
}
|
28 |
Â
|
29 |
Â
$wpforms_settings = get_option('wpforms_settings', []);
|
32 |
Â
|
33 |
Â
$this->replace_urls();
|
34 |
Â
|
35 |
+
do_action('customize_save_after');
|
36 |
Â
do_action('blocksy:dynamic-css:refresh-caches');
|
37 |
Â
Plugin::instance()->cache_manager->run_cache_purge();
|
38 |
Â
|
39 |
Â
if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
|
40 |
+
if (! defined('WP_CLI')) {
|
41 |
+
define('WP_CLI', true);
|
42 |
+
}
|
43 |
Â
|
44 |
Â
$s = new \WC_REST_System_Status_Tools_V2_Controller();
|
45 |
Â
|
77 |
Â
}
|
78 |
Â
}
|
79 |
Â
|
80 |
+
if ($this->has_streaming) {
|
81 |
+
Plugin::instance()->demo->emit_sse_message([
|
82 |
+
'action' => 'complete',
|
83 |
+
'error' => false,
|
84 |
+
]);
|
85 |
+
exit;
|
86 |
+
}
|
87 |
Â
}
|
88 |
Â
|
89 |
Â
/**
|
framework/features/demo-install/required-plugins.php
CHANGED
@@ -70,6 +70,7 @@ class DemoInstallPluginsInstaller {
|
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
$plugins_manager->prepare_install($single_plugin);
|
Â
|
|
73 |
Â
echo $single_plugin;
|
74 |
Â
|
75 |
Â
if ($this->has_streaming) {
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
$plugins_manager->prepare_install($single_plugin);
|
73 |
+
|
74 |
Â
echo $single_plugin;
|
75 |
Â
|
76 |
Â
if ($this->has_streaming) {
|
framework/features/header.php
CHANGED
@@ -551,15 +551,29 @@ class HeaderAdditions {
|
|
551 |
Â
|
552 |
Â
$body = json_decode(file_get_contents('php://input'), true);
|
553 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
554 |
Â
if ($body && isset($body['current_url'])) {
|
555 |
Â
$url = $body['current_url'];
|
556 |
Â
}
|
557 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
558 |
Â
$html = blc_call_fn(
|
559 |
Â
['fn' => 'blocksy_render_view'],
|
560 |
Â
dirname(__FILE__) . '/header/account-modal.php',
|
561 |
Â
[
|
562 |
-
'current_url' => $url
|
Â
|
|
Â
|
|
563 |
Â
]
|
564 |
Â
);
|
565 |
Â
|
551 |
Â
|
552 |
Â
$body = json_decode(file_get_contents('php://input'), true);
|
553 |
Â
|
554 |
+
$header_id = null;
|
555 |
+
|
556 |
+
if (isset($_REQUEST['header_id'])) {
|
557 |
+
$header_id = $_REQUEST['header_id'];
|
558 |
+
}
|
559 |
+
|
560 |
Â
if ($body && isset($body['current_url'])) {
|
561 |
Â
$url = $body['current_url'];
|
562 |
Â
}
|
563 |
Â
|
564 |
+
$render = new \Blocksy_Header_Builder_Render([
|
565 |
+
'current_section_id' => $header_id
|
566 |
+
]);
|
567 |
+
|
568 |
+
$atts = $render->get_item_data_for('account');
|
569 |
+
|
570 |
Â
$html = blc_call_fn(
|
571 |
Â
['fn' => 'blocksy_render_view'],
|
572 |
Â
dirname(__FILE__) . '/header/account-modal.php',
|
573 |
Â
[
|
574 |
+
'current_url' => $url,
|
575 |
+
'header_id' => $header_id,
|
576 |
+
'atts' => $atts
|
577 |
Â
]
|
578 |
Â
);
|
579 |
Â
|
framework/features/header/account-modal.php
CHANGED
@@ -28,11 +28,13 @@ foreach ($form_views as $form_key => $value) {
|
|
28 |
Â
);
|
29 |
Â
}
|
30 |
Â
|
Â
|
|
Â
|
|
31 |
Â
?>
|
32 |
Â
|
33 |
Â
<div id="account-modal" class="ct-panel" data-behaviour="modal">
|
34 |
Â
<div class="ct-panel-actions">
|
35 |
-
<span class="ct-close-button">
|
36 |
Â
<svg class="ct-icon" width="12" height="12" viewBox="0 0 15 15">
|
37 |
Â
<path d="M1 15a1 1 0 01-.71-.29 1 1 0 010-1.41l5.8-5.8-5.8-5.8A1 1 0 011.7.29l5.8 5.8 5.8-5.8a1 1 0 011.41 1.41l-5.8 5.8 5.8 5.8a1 1 0 01-1.41 1.41l-5.8-5.8-5.8 5.8A1 1 0 011 15z"/>
|
38 |
Â
</svg>
|
@@ -73,4 +75,3 @@ foreach ($form_views as $form_key => $value) {
|
|
73 |
Â
</div>
|
74 |
Â
</div>
|
75 |
Â
</div>
|
76 |
-
|
28 |
Â
);
|
29 |
Â
}
|
30 |
Â
|
31 |
+
$close_button_type = blocksy_akg('account_close_button_type', $atts, 'type-1');
|
32 |
+
|
33 |
Â
?>
|
34 |
Â
|
35 |
Â
<div id="account-modal" class="ct-panel" data-behaviour="modal">
|
36 |
Â
<div class="ct-panel-actions">
|
37 |
+
<span class="ct-close-button" data-type="<?php echo $close_button_type ?>">
|
38 |
Â
<svg class="ct-icon" width="12" height="12" viewBox="0 0 15 15">
|
39 |
Â
<path d="M1 15a1 1 0 01-.71-.29 1 1 0 010-1.41l5.8-5.8-5.8-5.8A1 1 0 011.7.29l5.8 5.8 5.8-5.8a1 1 0 011.41 1.41l-5.8 5.8 5.8 5.8a1 1 0 01-1.41 1.41l-5.8-5.8-5.8 5.8A1 1 0 011 15z"/>
|
40 |
Â
</svg>
|
75 |
Â
</div>
|
76 |
Â
</div>
|
77 |
Â
</div>
|
Â
|
framework/features/header/items/account/dynamic-styles.php
CHANGED
@@ -541,6 +541,7 @@ if ($forms_type !== 'classic-forms' || is_customize_preview()) {
|
|
541 |
Â
]);
|
542 |
Â
}
|
543 |
Â
|
Â
|
|
544 |
Â
|
545 |
Â
blocksy_output_colors([
|
546 |
Â
'value' => blocksy_akg('account_close_button_color', $atts),
|
@@ -581,41 +582,87 @@ blocksy_output_colors([
|
|
581 |
Â
],
|
582 |
Â
]);
|
583 |
Â
|
584 |
-
blocksy_output_colors([
|
585 |
-
'value' => blocksy_akg('account_close_button_shape_color', $atts),
|
586 |
-
'default' => [
|
587 |
-
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
588 |
-
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
589 |
-
],
|
590 |
-
'css' => $css,
|
591 |
Â
|
592 |
-
|
Â
|
|
Â
|
|
593 |
Â
'default' => [
|
594 |
-
'
|
595 |
-
|
596 |
-
'default' => $root_selector
|
597 |
-
], blc_call_fn([
|
598 |
-
'fn' => 'blocksy_mutate_selector',
|
599 |
-
], [
|
600 |
-
'selector' => [$root_selector[0]],
|
601 |
-
'operation' => 'suffix',
|
602 |
-
'to_add' => '#account-modal .ct-close-button'
|
603 |
-
])),
|
604 |
-
'variable' => 'closeButtonBackground'
|
605 |
Â
],
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
606 |
Â
|
607 |
-
'hover' => [
|
608 |
-
'selector' => blc_call_fn([
|
609 |
-
'fn' => 'blocksy_assemble_selector',
|
610 |
-
'default' => $root_selector
|
611 |
-
], blc_call_fn([
|
612 |
-
'fn' => 'blocksy_mutate_selector',
|
613 |
-
], [
|
614 |
-
'selector' => [$root_selector[0]],
|
615 |
-
'operation' => 'suffix',
|
616 |
-
'to_add' => '#account-modal .ct-close-button'
|
617 |
-
])),
|
618 |
-
'variable' => 'closeButtonHoverBackground'
|
619 |
-
]
|
620 |
-
],
|
621 |
-
]);
|
541 |
Â
]);
|
542 |
Â
}
|
543 |
Â
|
544 |
+
$close_button_type = blocksy_akg('account_close_button_type', $atts, 'type-1');
|
545 |
Â
|
546 |
Â
blocksy_output_colors([
|
547 |
Â
'value' => blocksy_akg('account_close_button_color', $atts),
|
582 |
Â
],
|
583 |
Â
]);
|
584 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
585 |
Â
|
586 |
+
if (is_customize_preview() || $close_button_type === 'type-2') {
|
587 |
+
blocksy_output_colors([
|
588 |
+
'value' => blocksy_akg('account_close_button_border_color', $atts),
|
589 |
Â
'default' => [
|
590 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
591 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
592 |
Â
],
|
593 |
+
'css' => $css,
|
594 |
+
|
595 |
+
'variables' => [
|
596 |
+
'default' => [
|
597 |
+
'selector' => blc_call_fn([
|
598 |
+
'fn' => 'blocksy_assemble_selector',
|
599 |
+
'default' => $root_selector
|
600 |
+
], blc_call_fn([
|
601 |
+
'fn' => 'blocksy_mutate_selector',
|
602 |
+
], [
|
603 |
+
'selector' => [$root_selector[0]],
|
604 |
+
'operation' => 'suffix',
|
605 |
+
'to_add' => '#account-modal .ct-close-button'
|
606 |
+
])),
|
607 |
+
'variable' => 'close-button-border-color'
|
608 |
+
],
|
609 |
+
|
610 |
+
'hover' => [
|
611 |
+
'selector' => blc_call_fn([
|
612 |
+
'fn' => 'blocksy_assemble_selector',
|
613 |
+
'default' => $root_selector
|
614 |
+
], blc_call_fn([
|
615 |
+
'fn' => 'blocksy_mutate_selector',
|
616 |
+
], [
|
617 |
+
'selector' => [$root_selector[0]],
|
618 |
+
'operation' => 'suffix',
|
619 |
+
'to_add' => '#account-modal .ct-close-button'
|
620 |
+
])),
|
621 |
+
'variable' => 'close-button-hover-border-color'
|
622 |
+
]
|
623 |
+
],
|
624 |
+
]);
|
625 |
+
}
|
626 |
+
|
627 |
+
if (is_customize_preview() || $close_button_type === 'type-3') {
|
628 |
+
|
629 |
+
blocksy_output_colors([
|
630 |
+
'value' => blocksy_akg('account_close_button_shape_color', $atts),
|
631 |
+
'default' => [
|
632 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
633 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
634 |
+
],
|
635 |
+
'css' => $css,
|
636 |
+
|
637 |
+
'variables' => [
|
638 |
+
'default' => [
|
639 |
+
'selector' => blc_call_fn([
|
640 |
+
'fn' => 'blocksy_assemble_selector',
|
641 |
+
'default' => $root_selector
|
642 |
+
], blc_call_fn([
|
643 |
+
'fn' => 'blocksy_mutate_selector',
|
644 |
+
], [
|
645 |
+
'selector' => [$root_selector[0]],
|
646 |
+
'operation' => 'suffix',
|
647 |
+
'to_add' => '#account-modal .ct-close-button'
|
648 |
+
])),
|
649 |
+
'variable' => 'close-button-background'
|
650 |
+
],
|
651 |
+
|
652 |
+
'hover' => [
|
653 |
+
'selector' => blc_call_fn([
|
654 |
+
'fn' => 'blocksy_assemble_selector',
|
655 |
+
'default' => $root_selector
|
656 |
+
], blc_call_fn([
|
657 |
+
'fn' => 'blocksy_mutate_selector',
|
658 |
+
], [
|
659 |
+
'selector' => [$root_selector[0]],
|
660 |
+
'operation' => 'suffix',
|
661 |
+
'to_add' => '#account-modal .ct-close-button'
|
662 |
+
])),
|
663 |
+
'variable' => 'close-button-hover-background'
|
664 |
+
]
|
665 |
+
],
|
666 |
+
]);
|
667 |
+
}
|
668 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
framework/features/header/items/account/options.php
CHANGED
@@ -935,6 +935,36 @@ $options = [
|
|
935 |
Â
],
|
936 |
Â
],
|
937 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
938 |
Â
'account_form_shadow' => [
|
939 |
Â
'label' => __( 'Modal Shadow', 'blocksy-companion' ),
|
940 |
Â
'type' => 'ct-box-shadow',
|
@@ -954,11 +984,27 @@ $options = [
|
|
954 |
Â
])
|
955 |
Â
],
|
956 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
957 |
Â
'account_close_button_color' => [
|
958 |
-
'label' => __( '
|
959 |
Â
'type' => 'ct-color-picker',
|
960 |
Â
'design' => 'inline',
|
961 |
-
'divider' => 'top',
|
962 |
Â
'setting' => [ 'transport' => 'postMessage' ],
|
963 |
Â
|
964 |
Â
'value' => [
|
@@ -986,65 +1032,87 @@ $options = [
|
|
986 |
Â
],
|
987 |
Â
],
|
988 |
Â
|
989 |
-
|
990 |
-
'
|
991 |
-
'
|
992 |
-
'
|
993 |
-
'setting' => [ 'transport' => 'postMessage' ],
|
994 |
Â
|
995 |
-
|
996 |
-
|
997 |
-
'
|
998 |
-
|
Â
|
|
999 |
Â
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
Â
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
1010 |
-
],
|
1011 |
Â
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1016 |
Â
],
|
Â
|
|
1017 |
Â
],
|
1018 |
Â
],
|
1019 |
Â
|
1020 |
-
|
1021 |
-
'
|
1022 |
-
'
|
1023 |
-
'
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
'
|
1029 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1030 |
Â
],
|
1031 |
-
],
|
1032 |
-
])
|
1033 |
-
],
|
1034 |
Â
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
Â
|
|
Â
|
|
1045 |
Â
],
|
1046 |
Â
],
|
1047 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1048 |
Â
],
|
1049 |
Â
|
1050 |
Â
],
|
935 |
Â
],
|
936 |
Â
],
|
937 |
Â
|
938 |
+
'accountHeaderFormBackground' => [
|
939 |
+
'label' => __( 'Modal Background', 'blocksy-companion' ),
|
940 |
+
'type' => 'ct-background',
|
941 |
+
'design' => 'inline',
|
942 |
+
'divider' => 'top',
|
943 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
944 |
+
'value' => blocksy_background_default_value([
|
945 |
+
'backgroundColor' => [
|
946 |
+
'default' => [
|
947 |
+
'color' => '#ffffff'
|
948 |
+
],
|
949 |
+
],
|
950 |
+
])
|
951 |
+
],
|
952 |
+
|
953 |
+
'accountHeaderBackground' => [
|
954 |
+
'label' => __( 'Modal Backdrop', 'blocksy-companion' ),
|
955 |
+
'type' => 'ct-background',
|
956 |
+
'design' => 'inline',
|
957 |
+
'divider' => 'top',
|
958 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
959 |
+
'value' => blocksy_background_default_value([
|
960 |
+
'backgroundColor' => [
|
961 |
+
'default' => [
|
962 |
+
'color' => 'rgba(18, 21, 25, 0.6)'
|
963 |
+
],
|
964 |
+
],
|
965 |
+
])
|
966 |
+
],
|
967 |
+
|
968 |
Â
'account_form_shadow' => [
|
969 |
Â
'label' => __( 'Modal Shadow', 'blocksy-companion' ),
|
970 |
Â
'type' => 'ct-box-shadow',
|
984 |
Â
])
|
985 |
Â
],
|
986 |
Â
|
987 |
+
'account_close_button_type' => [
|
988 |
+
'label' => __('Close Button Type', 'blocksy-companion'),
|
989 |
+
'type' => 'ct-select',
|
990 |
+
'value' => 'type-1',
|
991 |
+
'view' => 'text',
|
992 |
+
'design' => 'inline',
|
993 |
+
'divider' => 'top',
|
994 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
995 |
+
'choices' => blocksy_ordered_keys(
|
996 |
+
[
|
997 |
+
'type-1' => __( 'Simple', 'blocksy-companion' ),
|
998 |
+
'type-2' => __( 'Border', 'blocksy-companion' ),
|
999 |
+
'type-3' => __( 'Background', 'blocksy-companion' ),
|
1000 |
+
]
|
1001 |
+
),
|
1002 |
+
],
|
1003 |
+
|
1004 |
Â
'account_close_button_color' => [
|
1005 |
+
'label' => __( 'Icon Color', 'blocksy-companion' ),
|
1006 |
Â
'type' => 'ct-color-picker',
|
1007 |
Â
'design' => 'inline',
|
Â
|
|
1008 |
Â
'setting' => [ 'transport' => 'postMessage' ],
|
1009 |
Â
|
1010 |
Â
'value' => [
|
1032 |
Â
],
|
1033 |
Â
],
|
1034 |
Â
|
1035 |
+
blocksy_rand_md5() => [
|
1036 |
+
'type' => 'ct-condition',
|
1037 |
+
'condition' => [ 'account_close_button_type' => 'type-2' ],
|
1038 |
+
'options' => [
|
Â
|
|
1039 |
Â
|
1040 |
+
'account_close_button_border_color' => [
|
1041 |
+
'label' => __( 'Border Color', 'blocksy-companion' ),
|
1042 |
+
'type' => 'ct-color-picker',
|
1043 |
+
'design' => 'inline',
|
1044 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
1045 |
Â
|
1046 |
+
'value' => [
|
1047 |
+
'default' => [
|
1048 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
1049 |
+
],
|
1050 |
Â
|
1051 |
+
'hover' => [
|
1052 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
1053 |
+
],
|
1054 |
+
],
|
Â
|
|
Â
|
|
1055 |
Â
|
1056 |
+
'pickers' => [
|
1057 |
+
[
|
1058 |
+
'title' => __( 'Initial', 'blocksy-companion' ),
|
1059 |
+
'id' => 'default',
|
1060 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
1061 |
+
],
|
1062 |
+
|
1063 |
+
[
|
1064 |
+
'title' => __( 'Hover', 'blocksy-companion' ),
|
1065 |
+
'id' => 'hover',
|
1066 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
1067 |
+
],
|
1068 |
+
],
|
1069 |
Â
],
|
1070 |
+
|
1071 |
Â
],
|
1072 |
Â
],
|
1073 |
Â
|
1074 |
+
blocksy_rand_md5() => [
|
1075 |
+
'type' => 'ct-condition',
|
1076 |
+
'condition' => [ 'account_close_button_type' => 'type-3' ],
|
1077 |
+
'options' => [
|
1078 |
+
|
1079 |
+
'account_close_button_shape_color' => [
|
1080 |
+
'label' => __( 'Background Color', 'blocksy-companion' ),
|
1081 |
+
'type' => 'ct-color-picker',
|
1082 |
+
'design' => 'inline',
|
1083 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
1084 |
+
|
1085 |
+
'value' => [
|
1086 |
+
'default' => [
|
1087 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
1088 |
+
],
|
1089 |
+
|
1090 |
+
'hover' => [
|
1091 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
1092 |
+
],
|
1093 |
Â
],
|
Â
|
|
Â
|
|
Â
|
|
1094 |
Â
|
1095 |
+
'pickers' => [
|
1096 |
+
[
|
1097 |
+
'title' => __( 'Initial', 'blocksy-companion' ),
|
1098 |
+
'id' => 'default',
|
1099 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
1100 |
+
],
|
1101 |
+
|
1102 |
+
[
|
1103 |
+
'title' => __( 'Hover', 'blocksy-companion' ),
|
1104 |
+
'id' => 'hover',
|
1105 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
1106 |
+
],
|
1107 |
Â
],
|
1108 |
Â
],
|
1109 |
+
|
1110 |
+
],
|
1111 |
+
],
|
1112 |
+
|
1113 |
+
blocksy_rand_md5() => [
|
1114 |
+
'type' => 'ct-spacer',
|
1115 |
+
'height' => 50
|
1116 |
Â
],
|
1117 |
Â
|
1118 |
Â
],
|
framework/features/header/items/account/sync.js
CHANGED
@@ -153,16 +153,30 @@ ctEvents.on(
|
|
153 |
Â
},
|
154 |
Â
],
|
155 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
156 |
Â
account_close_button_shape_color: [
|
157 |
Â
{
|
158 |
Â
selector: '#account-modal .ct-close-button',
|
159 |
-
variable: '
|
160 |
Â
type: 'color:default',
|
161 |
Â
},
|
162 |
Â
|
163 |
Â
{
|
164 |
Â
selector: '#account-modal .ct-close-button',
|
165 |
-
variable: '
|
166 |
Â
type: 'color:hover',
|
167 |
Â
},
|
168 |
Â
],
|
@@ -417,4 +431,26 @@ ctEvents.on('ct:header:sync:item:account', ({ optionId, optionValue }) => {
|
|
417 |
Â
{ onlyView: 'mobile' }
|
418 |
Â
)
|
419 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
420 |
Â
})
|
153 |
Â
},
|
154 |
Â
],
|
155 |
Â
|
156 |
+
account_close_button_border_color: [
|
157 |
+
{
|
158 |
+
selector: '#account-modal .ct-close-button',
|
159 |
+
variable: 'close-button-border-color',
|
160 |
+
type: 'color:default',
|
161 |
+
},
|
162 |
+
|
163 |
+
{
|
164 |
+
selector: '#account-modal .ct-close-button',
|
165 |
+
variable: 'close-button-hover-border-color',
|
166 |
+
type: 'color:hover',
|
167 |
+
},
|
168 |
+
],
|
169 |
+
|
170 |
Â
account_close_button_shape_color: [
|
171 |
Â
{
|
172 |
Â
selector: '#account-modal .ct-close-button',
|
173 |
+
variable: 'close-button-background',
|
174 |
Â
type: 'color:default',
|
175 |
Â
},
|
176 |
Â
|
177 |
Â
{
|
178 |
Â
selector: '#account-modal .ct-close-button',
|
179 |
+
variable: 'close-button-hover-background',
|
180 |
Â
type: 'color:hover',
|
181 |
Â
},
|
182 |
Â
],
|
431 |
Â
{ onlyView: 'mobile' }
|
432 |
Â
)
|
433 |
Â
}
|
434 |
+
|
435 |
+
if (optionId === 'account_close_button_type') {
|
436 |
+
let offcanvasModalClose = document.querySelector(
|
437 |
+
'#account-modal .ct-close-button'
|
438 |
+
)
|
439 |
+
|
440 |
+
setTimeout(() => {
|
441 |
+
offcanvasModalClose.classList.add('ct-disable-transitions')
|
442 |
+
|
443 |
+
requestAnimationFrame(() => {
|
444 |
+
if (offcanvasModalClose) {
|
445 |
+
offcanvasModalClose.dataset.type = optionValue
|
446 |
+
}
|
447 |
+
|
448 |
+
setTimeout(() => {
|
449 |
+
offcanvasModalClose.classList.remove(
|
450 |
+
'ct-disable-transitions'
|
451 |
+
)
|
452 |
+
})
|
453 |
+
})
|
454 |
+
}, 300)
|
455 |
+
}
|
456 |
Â
})
|
framework/features/header/modal/login.php
CHANGED
@@ -1,50 +1,71 @@
|
|
1 |
Â
<?php
|
2 |
Â
|
3 |
Â
// wp_login_form([]);
|
4 |
-
|
5 |
-
$redirect_to_url = apply_filters(
|
6 |
-
'blocksy:account:modal:login:redirect_to',
|
7 |
-
$current_url
|
8 |
-
);
|
9 |
-
|
10 |
Â
?>
|
11 |
Â
|
12 |
-
<form name="loginform" id="loginform" action="<?php
|
13 |
-
|
14 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
15 |
Â
|
16 |
Â
<p class="login-username">
|
17 |
-
<label for="user_login"><?php
|
Â
|
|
Â
|
|
18 |
Â
<input type="text" name="log" id="user_login" class="input" value="" size="20">
|
19 |
Â
</p>
|
20 |
Â
|
21 |
Â
<p class="login-password">
|
22 |
-
<label for="user_pass"><?php
|
Â
|
|
Â
|
|
23 |
Â
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
|
24 |
Â
</p>
|
25 |
Â
|
26 |
Â
<p class="login-remember col-2">
|
27 |
Â
<label>
|
28 |
Â
<input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
|
29 |
-
<?php
|
Â
|
|
Â
|
|
30 |
Â
</label>
|
31 |
Â
|
32 |
-
<a href="<?php
|
33 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
34 |
Â
</a>
|
35 |
Â
</p>
|
36 |
Â
|
37 |
-
<?php
|
Â
|
|
Â
|
|
38 |
Â
|
39 |
Â
<p class="login-submit">
|
40 |
Â
<button name="wp-submit" class="ct-button">
|
41 |
-
<?php
|
Â
|
|
Â
|
|
42 |
Â
</button>
|
43 |
Â
|
44 |
-
<input type="hidden" name="redirect_to" value="<?php
|
Â
|
|
Â
|
|
45 |
Â
</p>
|
46 |
Â
|
47 |
-
<?php
|
48 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
49 |
Â
</form>
|
50 |
Â
|
1 |
Â
<?php
|
2 |
Â
|
3 |
Â
// wp_login_form([]);
|
4 |
+
$redirect_to_url = apply_filters( 'blocksy:account:modal:login:redirect_to', $current_url );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
5 |
Â
?>
|
6 |
Â
|
7 |
+
<form name="loginform" id="loginform" action="<?php
|
8 |
+
echo wp_login_url() ;
|
9 |
+
?>" method="post">
|
10 |
+
<?php
|
11 |
+
do_action( 'woocommerce_login_form_start' );
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
do_action( 'blocksy:account:modal:login:start' );
|
15 |
+
?>
|
16 |
Â
|
17 |
Â
<p class="login-username">
|
18 |
+
<label for="user_login"><?php
|
19 |
+
echo __( 'Email Address', 'blocksy-companion' ) ;
|
20 |
+
?></label>
|
21 |
Â
<input type="text" name="log" id="user_login" class="input" value="" size="20">
|
22 |
Â
</p>
|
23 |
Â
|
24 |
Â
<p class="login-password">
|
25 |
+
<label for="user_pass"><?php
|
26 |
+
echo __( 'Password', 'blocksy-companion' ) ;
|
27 |
+
?></label>
|
28 |
Â
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
|
29 |
Â
</p>
|
30 |
Â
|
31 |
Â
<p class="login-remember col-2">
|
32 |
Â
<label>
|
33 |
Â
<input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
|
34 |
+
<?php
|
35 |
+
echo __( 'Remember Me', 'blocksy-companion' ) ;
|
36 |
+
?>
|
37 |
Â
</label>
|
38 |
Â
|
39 |
+
<a href="<?php
|
40 |
+
echo wp_lostpassword_url() ;
|
41 |
+
?>" class="ct-forgot-password">
|
42 |
+
<?php
|
43 |
+
echo __( 'Forgot Password?', 'blocksy-companion' ) ;
|
44 |
+
?>
|
45 |
Â
</a>
|
46 |
Â
</p>
|
47 |
Â
|
48 |
+
<?php
|
49 |
+
do_action( 'login_form' );
|
50 |
+
?>
|
51 |
Â
|
52 |
Â
<p class="login-submit">
|
53 |
Â
<button name="wp-submit" class="ct-button">
|
54 |
+
<?php
|
55 |
+
echo __( 'Log In', 'blocksy-companion' ) ;
|
56 |
+
?>
|
57 |
Â
</button>
|
58 |
Â
|
59 |
+
<input type="hidden" name="redirect_to" value="<?php
|
60 |
+
echo $redirect_to_url ;
|
61 |
+
?>">
|
62 |
Â
</p>
|
63 |
Â
|
64 |
+
<?php
|
65 |
+
do_action( 'blocksy:account:modal:login:end' );
|
66 |
+
?>
|
67 |
+
<?php
|
68 |
+
do_action( 'woocommerce_login_form_end' );
|
69 |
+
?>
|
70 |
Â
</form>
|
71 |
Â
|
framework/features/header/modal/lostpassword.php
CHANGED
@@ -6,6 +6,8 @@
|
|
6 |
Â
<input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
|
7 |
Â
</p>
|
8 |
Â
|
Â
|
|
Â
|
|
9 |
Â
<p>
|
10 |
Â
<button name="wp-submit" class="ct-button">
|
11 |
Â
<?php echo __('Get New Password', 'blocksy-companion') ?>
|
6 |
Â
<input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
|
7 |
Â
</p>
|
8 |
Â
|
9 |
+
<?php do_action('lostpassword_form'); ?>
|
10 |
+
|
11 |
Â
<p>
|
12 |
Â
<button name="wp-submit" class="ct-button">
|
13 |
Â
<?php echo __('Get New Password', 'blocksy-companion') ?>
|
framework/features/header/modal/register.php
CHANGED
@@ -1,32 +1,89 @@
|
|
1 |
-
|
2 |
-
<?php do_action('woocommerce_register_form_start') ?>
|
3 |
-
<?php do_action('blocksy:account:modal:register:start'); ?>
|
4 |
Â
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
9 |
Â
|
10 |
Â
<p>
|
11 |
-
<label for="user_email"><?php
|
Â
|
|
Â
|
|
12 |
Â
<input type="email" name="user_email" id="user_email" class="input" value="" size="25">
|
13 |
Â
</p>
|
14 |
Â
|
15 |
-
<?php
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
16 |
Â
|
17 |
Â
<p id="reg_passmail">
|
18 |
-
<?php
|
Â
|
|
Â
|
|
19 |
Â
</p>
|
20 |
Â
|
21 |
Â
<p>
|
22 |
Â
<button name="wp-submit" class="ct-button">
|
23 |
-
<?php
|
Â
|
|
Â
|
|
24 |
Â
</button>
|
25 |
Â
|
26 |
-
<!-- <input type="hidden" name="redirect_to" value="<?php
|
Â
|
|
Â
|
|
27 |
Â
</p>
|
28 |
Â
|
29 |
-
<?php
|
30 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
31 |
Â
</form>
|
32 |
Â
|
1 |
+
<?php
|
Â
|
|
Â
|
|
2 |
Â
|
3 |
+
$has_username = true;
|
4 |
+
$has_password = false;
|
5 |
+
if ( function_exists( 'wc_create_new_customer' ) && 'no' !== get_option( 'woocommerce_registration_generate_username' ) ) {
|
6 |
+
$has_username = false;
|
7 |
+
}
|
8 |
+
if ( function_exists( 'wc_create_new_customer' ) && 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
|
9 |
+
$has_password = true;
|
10 |
+
}
|
11 |
+
?>
|
12 |
+
|
13 |
+
<form name="registerform" id="registerform" action="<?php
|
14 |
+
echo wp_registration_url() ;
|
15 |
+
?>" method="post" novalidate="novalidate">
|
16 |
+
<?php
|
17 |
+
do_action( 'woocommerce_register_form_start' );
|
18 |
+
?>
|
19 |
+
<?php
|
20 |
+
do_action( 'blocksy:account:modal:register:start' );
|
21 |
+
?>
|
22 |
+
|
23 |
+
<?php
|
24 |
+
|
25 |
+
if ( $has_username ) {
|
26 |
+
?>
|
27 |
+
<p>
|
28 |
+
<label for="user_login_register"><?php
|
29 |
+
echo __( 'Username', 'blocksy-companion' ) ;
|
30 |
+
?></label>
|
31 |
+
<input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
|
32 |
+
</p>
|
33 |
+
<?php
|
34 |
+
}
|
35 |
+
|
36 |
+
?>
|
37 |
Â
|
38 |
Â
<p>
|
39 |
+
<label for="user_email"><?php
|
40 |
+
echo __( 'Email', 'blocksy-companion' ) ;
|
41 |
+
?></label>
|
42 |
Â
<input type="email" name="user_email" id="user_email" class="input" value="" size="25">
|
43 |
Â
</p>
|
44 |
Â
|
45 |
+
<?php
|
46 |
+
|
47 |
+
if ( $has_password ) {
|
48 |
+
?>
|
49 |
+
<p>
|
50 |
+
<label for="user_pass_register"><?php
|
51 |
+
echo __( 'Password', 'blocksy-companion' ) ;
|
52 |
+
?></label>
|
53 |
+
<input type="password" name="user_pass" id="user_pass_register" class="input" value="" size="20" autocapitalize="off" autocomplete="new-password">
|
54 |
+
</p>
|
55 |
+
<?php
|
56 |
+
}
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
<?php
|
61 |
+
do_action( 'register_form' );
|
62 |
+
?>
|
63 |
Â
|
64 |
Â
<p id="reg_passmail">
|
65 |
+
<?php
|
66 |
+
echo __( 'Registration confirmation will be emailed to you', 'blocksy-companion' ) ;
|
67 |
+
?>
|
68 |
Â
</p>
|
69 |
Â
|
70 |
Â
<p>
|
71 |
Â
<button name="wp-submit" class="ct-button">
|
72 |
+
<?php
|
73 |
+
echo __( 'Register', 'blocksy-companion' ) ;
|
74 |
+
?>
|
75 |
Â
</button>
|
76 |
Â
|
77 |
+
<!-- <input type="hidden" name="redirect_to" value="<?php
|
78 |
+
echo blocksy_current_url() ;
|
79 |
+
?>"> -->
|
80 |
Â
</p>
|
81 |
Â
|
82 |
+
<?php
|
83 |
+
do_action( 'blocksy:account:modal:register:end' );
|
84 |
+
?>
|
85 |
+
<?php
|
86 |
+
do_action( 'woocommerce_register_form_end' );
|
87 |
+
?>
|
88 |
Â
</form>
|
89 |
Â
|
framework/helpers/blocksy-integration.php
CHANGED
@@ -169,7 +169,7 @@ if (! function_exists('blocksy_attr_to_html')) {
|
|
169 |
Â
continue;
|
170 |
Â
}
|
171 |
Â
|
172 |
-
$html_attr .= $attr_name . '="' .
|
173 |
Â
}
|
174 |
Â
|
175 |
Â
return $html_attr;
|
169 |
Â
continue;
|
170 |
Â
}
|
171 |
Â
|
172 |
+
$html_attr .= $attr_name . '="' . $attr_val . '" ';
|
173 |
Â
}
|
174 |
Â
|
175 |
Â
return $html_attr;
|
framework/theme-integration.php
CHANGED
@@ -4,16 +4,6 @@ namespace Blocksy;
|
|
4 |
Â
|
5 |
Â
class ThemeIntegration {
|
6 |
Â
public function __construct() {
|
7 |
-
add_action(
|
8 |
-
'wp_ajax_blc_implement_user_registration',
|
9 |
-
[$this, 'blc_implement_user_registration']
|
10 |
-
);
|
11 |
-
|
12 |
-
add_action(
|
13 |
-
'wp_ajax_nopriv_blc_implement_user_registration',
|
14 |
-
[$this, 'blc_implement_user_registration']
|
15 |
-
);
|
16 |
-
|
17 |
Â
add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
|
18 |
Â
$chunks[] = [
|
19 |
Â
'id' => 'blocksy_account',
|
@@ -365,7 +355,7 @@ class ThemeIntegration {
|
|
365 |
Â
}
|
366 |
Â
|
367 |
Â
if (
|
368 |
-
blc_fs()->
|
369 |
Â
&&
|
370 |
Â
BLOCKSY_PATH . '/framework/premium/changelog.txt'
|
371 |
Â
) {
|
@@ -454,66 +444,5 @@ class ThemeIntegration {
|
|
454 |
Â
'orientation' => ($width > $height) ? 'landscape' : 'portrait'
|
455 |
Â
);
|
456 |
Â
}
|
457 |
-
|
458 |
-
public function blc_implement_user_registration() {
|
459 |
-
ob_start();
|
460 |
-
require_once ABSPATH . 'wp-login.php';
|
461 |
-
$res = ob_get_clean();
|
462 |
-
|
463 |
-
$users_can_register = get_option('users_can_register');
|
464 |
-
|
465 |
-
if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
|
466 |
-
$users_can_register = true;
|
467 |
-
}
|
468 |
-
|
469 |
-
if (! $users_can_register) {
|
470 |
-
exit;
|
471 |
-
}
|
472 |
-
|
473 |
-
$user_login = '';
|
474 |
-
$user_email = '';
|
475 |
-
|
476 |
-
if (
|
477 |
-
isset($_POST['user_login'])
|
478 |
-
&&
|
479 |
-
is_string($_POST['user_login'])
|
480 |
-
) {
|
481 |
-
$user_login = wp_unslash( $_POST['user_login'] );
|
482 |
-
}
|
483 |
-
|
484 |
-
if (isset($_POST['user_email']) && is_string($_POST['user_email'])) {
|
485 |
-
$user_email = wp_unslash( $_POST['user_email'] );
|
486 |
-
}
|
487 |
-
|
488 |
-
$errors = register_new_user($user_login, $user_email);
|
489 |
-
|
490 |
-
if (! is_wp_error($errors)) {
|
491 |
-
$errors = new \WP_Error();
|
492 |
-
|
493 |
-
$errors->add(
|
494 |
-
'registered',
|
495 |
-
sprintf(
|
496 |
-
/* translators: %s: Link to the login page. */
|
497 |
-
__( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
|
498 |
-
wp_login_url()
|
499 |
-
),
|
500 |
-
'message'
|
501 |
-
);
|
502 |
-
|
503 |
-
$redirect_to = admin_url();
|
504 |
-
$errors = apply_filters('wp_login_errors', $errors, $redirect_to);
|
505 |
-
|
506 |
-
login_header(__('Check your email', 'blocksy-companion'), '', $errors);
|
507 |
-
|
508 |
-
wp_die();
|
509 |
-
}
|
510 |
-
|
511 |
-
login_header(
|
512 |
-
__('Registration Form', 'blocksy-companion'),
|
513 |
-
'<p class="message register">' . __('Register For This Site', 'blocksy-companion') . '</p>',
|
514 |
-
$errors
|
515 |
-
);
|
516 |
-
|
517 |
-
wp_die();
|
518 |
-
}
|
519 |
Â
}
|
Â
|
4 |
Â
|
5 |
Â
class ThemeIntegration {
|
6 |
Â
public function __construct() {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
7 |
Â
add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
|
8 |
Â
$chunks[] = [
|
9 |
Â
'id' => 'blocksy_account',
|
355 |
Â
}
|
356 |
Â
|
357 |
Â
if (
|
358 |
+
blc_fs()->can_use_premium_code__premium_only()
|
359 |
Â
&&
|
360 |
Â
BLOCKSY_PATH . '/framework/premium/changelog.txt'
|
361 |
Â
) {
|
444 |
Â
'orientation' => ($width > $height) ? 'landscape' : 'portrait'
|
445 |
Â
);
|
446 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
447 |
Â
}
|
448 |
+
|
freemius/includes/class-freemius.php
CHANGED
@@ -1,25364 +1,25395 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
-
exit;
|
10 |
-
}
|
11 |
-
|
12 |
-
// "final class"
|
13 |
-
class Freemius extends Freemius_Abstract {
|
14 |
-
/**
|
15 |
-
* SDK Version
|
16 |
-
*
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
public $version = WP_FS__SDK_VERSION;
|
20 |
-
|
21 |
-
#region Plugin Info
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @since 1.0.1
|
25 |
-
*
|
26 |
-
* @var string
|
27 |
-
*/
|
28 |
-
private $_slug;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @since 1.0.0
|
32 |
-
*
|
33 |
-
* @var string
|
34 |
-
*/
|
35 |
-
private $_plugin_basename;
|
36 |
-
/**
|
37 |
-
* @since 2.2.1
|
38 |
-
*
|
39 |
-
* @var string
|
40 |
-
*/
|
41 |
-
private $_premium_plugin_basename;
|
42 |
-
/**
|
43 |
-
* @since 1.0.0
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
private $_free_plugin_basename;
|
48 |
-
/**
|
49 |
-
* @since 1.0.0
|
50 |
-
*
|
51 |
-
* @var string
|
52 |
-
*/
|
53 |
-
private $_plugin_dir_path;
|
54 |
-
/**
|
55 |
-
* @since 1.0.0
|
56 |
-
*
|
57 |
-
* @var string
|
58 |
-
*/
|
59 |
-
private $_plugin_dir_name;
|
60 |
-
/**
|
61 |
-
* @since 1.0.0
|
62 |
-
*
|
63 |
-
* @var string
|
64 |
-
*/
|
65 |
-
private $_plugin_main_file_path;
|
66 |
-
/**
|
67 |
-
* @var string[]
|
68 |
-
*/
|
69 |
-
private $_plugin_data;
|
70 |
-
/**
|
71 |
-
* @since 1.0.9
|
72 |
-
*
|
73 |
-
* @var string
|
74 |
-
*/
|
75 |
-
private $_plugin_name;
|
76 |
-
/**
|
77 |
-
* @since 1.2.2
|
78 |
-
*
|
79 |
-
* @var string
|
80 |
-
*/
|
81 |
-
private $_module_type;
|
82 |
-
|
83 |
-
#endregion Plugin Info
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @since 1.0.9
|
87 |
-
*
|
88 |
-
* @var bool If false, don't turn Freemius on.
|
89 |
-
*/
|
90 |
-
private $_is_on;
|
91 |
-
|
92 |
-
/**
|
93 |
-
* @since 1.1.3
|
94 |
-
*
|
95 |
-
* @var bool If false, don't turn Freemius on.
|
96 |
-
*/
|
97 |
-
private $_is_anonymous;
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @since 1.0.9
|
101 |
-
* @var bool If false, issues with connectivity to Freemius API.
|
102 |
-
*/
|
103 |
-
private $_has_api_connection;
|
104 |
-
|
105 |
-
/**
|
106 |
-
* @since 1.0.9
|
107 |
-
* @since 2.0.0 Default to true since we need the property during the instance construction, prior to the dynamic_init() execution.
|
108 |
-
* @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
|
109 |
-
*/
|
110 |
-
private $_enable_anonymous = true;
|
111 |
-
|
112 |
-
/**
|
113 |
-
* @since 1.1.7.5
|
114 |
-
* @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
|
115 |
-
*/
|
116 |
-
private $_anonymous_mode;
|
117 |
-
|
118 |
-
/**
|
119 |
-
* @since 1.1.9
|
120 |
-
* @var bool Hints the SDK if plugin have any free plans.
|
121 |
-
*/
|
122 |
-
private $_is_premium_only;
|
123 |
-
|
124 |
-
/**
|
125 |
-
* @since 1.2.1.6
|
126 |
-
* @var bool Hints the SDK if plugin have premium code version at all.
|
127 |
-
*/
|
128 |
-
private $_has_premium_version;
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @since 1.2.1.6
|
132 |
-
* @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
|
133 |
-
*/
|
134 |
-
private $_ignore_pending_mode;
|
135 |
-
|
136 |
-
/**
|
137 |
-
* @since 1.0.8
|
138 |
-
* @var bool Hints the SDK if the plugin has any paid plans.
|
139 |
-
*/
|
140 |
-
private $_has_paid_plans;
|
141 |
-
|
142 |
-
/**
|
143 |
-
* @since 1.2.1.5
|
144 |
-
* @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
|
145 |
-
* without a specified period, if positive - the number of trial days.
|
146 |
-
*/
|
147 |
-
private $_trial_days = - 1;
|
148 |
-
|
149 |
-
/**
|
150 |
-
* @since 1.2.1.5
|
151 |
-
* @var bool Hints the SDK if the trial requires a payment method or not.
|
152 |
-
*/
|
153 |
-
private $_is_trial_require_payment = false;
|
154 |
-
|
155 |
-
/**
|
156 |
-
* @since 1.0.7
|
157 |
-
* @var bool Hints the SDK if the plugin is WordPress.org compliant.
|
158 |
-
*/
|
159 |
-
private $_is_org_compliant;
|
160 |
-
|
161 |
-
/**
|
162 |
-
* @since 1.0.7
|
163 |
-
* @var bool Hints the SDK if the plugin is has add-ons.
|
164 |
-
*/
|
165 |
-
private $_has_addons;
|
166 |
-
|
167 |
-
/**
|
168 |
-
* @since 2.4.5
|
169 |
-
* @var string Navigation type: 'menu' or 'tabs'.
|
170 |
-
*/
|
171 |
-
private $_navigation;
|
172 |
-
|
173 |
-
const NAVIGATION_MENU = 'menu';
|
174 |
-
const NAVIGATION_TABS = 'tabs';
|
175 |
-
|
176 |
-
/**
|
177 |
-
* @since 1.1.6
|
178 |
-
* @var string[]bool.
|
179 |
-
*/
|
180 |
-
private $_permissions;
|
181 |
-
|
182 |
-
/**
|
183 |
-
* @var FS_Storage
|
184 |
-
*/
|
185 |
-
private $_storage;
|
186 |
-
|
187 |
-
/**
|
188 |
-
* @since 1.2.2.7
|
189 |
-
* @var FS_Cache_Manager
|
190 |
-
*/
|
191 |
-
private $_cache;
|
192 |
-
|
193 |
-
/**
|
194 |
-
* @since 1.0.0
|
195 |
-
*
|
196 |
-
* @var FS_Logger
|
197 |
-
*/
|
198 |
-
private $_logger;
|
199 |
-
/**
|
200 |
-
* @since 1.0.4
|
201 |
-
*
|
202 |
-
|
203 |
-
*/
|
204 |
-
private $_plugin = false;
|
205 |
-
/**
|
206 |
-
* @since 1.0.4
|
207 |
-
*
|
208 |
-
* @var FS_Plugin|false
|
209 |
-
*/
|
210 |
-
private $_parent_plugin = false;
|
211 |
-
/**
|
212 |
-
* @since 1.1.1
|
213 |
-
*
|
214 |
-
* @var Freemius
|
215 |
-
*/
|
216 |
-
private $_parent = false;
|
217 |
-
/**
|
218 |
-
* @since 1.0.1
|
219 |
-
*
|
220 |
-
* @var FS_User
|
221 |
-
*/
|
222 |
-
private $_user = false;
|
223 |
-
/**
|
224 |
-
* @since 1.0.1
|
225 |
-
*
|
226 |
-
* @var FS_Site
|
227 |
-
*/
|
228 |
-
private $_site = false;
|
229 |
-
/**
|
230 |
-
* @since 1.0.1
|
231 |
-
*
|
232 |
-
* @var FS_Plugin_License
|
233 |
-
*/
|
234 |
-
private $_license;
|
235 |
-
/**
|
236 |
-
* @since 1.0.2
|
237 |
-
*
|
238 |
-
* @var FS_Plugin_Plan[]
|
239 |
-
*/
|
240 |
-
private $_plans = false;
|
241 |
-
/**
|
242 |
-
* @var FS_Plugin_License[]
|
243 |
-
* @since 1.0.5
|
244 |
-
*/
|
245 |
-
private $_licenses = false;
|
246 |
-
|
247 |
-
/**
|
248 |
-
* @since 1.0.1
|
249 |
-
*
|
250 |
-
* @var FS_Admin_Menu_Manager
|
251 |
-
*/
|
252 |
-
private $_menu;
|
253 |
-
|
254 |
-
/**
|
255 |
-
* @var FS_Admin_Notices
|
256 |
-
*/
|
257 |
-
private $_admin_notices;
|
258 |
-
|
259 |
-
/**
|
260 |
-
* @since 1.1.6
|
261 |
-
*
|
262 |
-
* @var FS_Admin_Notices
|
263 |
-
*/
|
264 |
-
private static $_global_admin_notices;
|
265 |
-
|
266 |
-
/**
|
267 |
-
* @var FS_Logger
|
268 |
-
* @since 1.0.0
|
269 |
-
*/
|
270 |
-
private static $_static_logger;
|
271 |
-
|
272 |
-
/**
|
273 |
-
* @var FS_Options
|
274 |
-
* @since 1.0.2
|
275 |
-
*/
|
276 |
-
private static $_accounts;
|
277 |
-
|
278 |
-
/**
|
279 |
-
* @since 1.2.2
|
280 |
-
*
|
281 |
-
* @var number
|
282 |
-
*/
|
283 |
-
private $_module_id;
|
284 |
-
|
285 |
-
/**
|
286 |
-
* @var Freemius[]
|
287 |
-
*/
|