Version Description
- Fixed #2490, #2450, #326
Download this release
Release Info
Developer | Unyson |
Plugin | Unyson |
Version | 2.6.16 |
Comparing to | |
See all releases |
Code changes from version 2.6.15 to 2.6.16
- framework/bootstrap.php +6 -0
- framework/core/components/backend.php +7 -9
- framework/core/components/extensions/manager/class--fw-extensions-manager.php +8 -0
- framework/core/extends/class-fw-extension.php +1 -1
- framework/helpers/class-fw-callback.php +25 -10
- framework/helpers/class-fw-db-options-model.php +15 -7
- framework/helpers/class-fw-wp-option.php +1 -1
- framework/helpers/general.php +50 -14
- framework/includes/hooks.php +22 -0
- framework/manifest.php +1 -1
- framework/static/js/fw.js +10 -1
- framework/views/backend-settings-form.php +1 -0
- readme.txt +4 -1
- unyson.php +1 -1
framework/bootstrap.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php if (!defined('ABSPATH')) die('Forbidden');
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
if (defined('FW')) {
|
4 |
/**
|
5 |
* The framework is already loaded.
|
1 |
<?php if (!defined('ABSPATH')) die('Forbidden');
|
2 |
|
3 |
+
if ( defined( 'WP_CLI' ) && WP_CLI && ! isset( $_SERVER['HTTP_HOST'] ) ) {
|
4 |
+
$_SERVER['HTTP_HOST'] = 'unyson.io';
|
5 |
+
$_SERVER['SERVER_NAME'] = 'unyson';
|
6 |
+
$_SERVER['SERVER_PORT'] = '80';
|
7 |
+
}
|
8 |
+
|
9 |
if (defined('FW')) {
|
10 |
/**
|
11 |
* The framework is already loaded.
|
framework/core/components/backend.php
CHANGED
@@ -1036,8 +1036,6 @@ final class _FW_Component_Backend {
|
|
1036 |
}
|
1037 |
|
1038 |
public function _action_admin_enqueue_scripts() {
|
1039 |
-
global $current_screen, $plugin_page, $post;
|
1040 |
-
|
1041 |
/**
|
1042 |
* Enqueue settings options static in <head>
|
1043 |
* @see FW_Settings_Form_Theme::_action_admin_enqueue_scripts()
|
@@ -1047,12 +1045,12 @@ final class _FW_Component_Backend {
|
|
1047 |
* Enqueue post options static in <head>
|
1048 |
*/
|
1049 |
{
|
1050 |
-
if ( 'post' ===
|
1051 |
fw()->backend->enqueue_options_static(
|
1052 |
-
fw()->theme->get_post_options(
|
1053 |
);
|
1054 |
|
1055 |
-
do_action( 'fw_admin_enqueue_scripts:post',
|
1056 |
}
|
1057 |
}
|
1058 |
|
@@ -1061,15 +1059,15 @@ final class _FW_Component_Backend {
|
|
1061 |
*/
|
1062 |
{
|
1063 |
if (
|
1064 |
-
in_array(
|
1065 |
&&
|
1066 |
-
|
1067 |
) {
|
1068 |
fw()->backend->enqueue_options_static(
|
1069 |
-
fw()->theme->get_taxonomy_options(
|
1070 |
);
|
1071 |
|
1072 |
-
do_action( 'fw_admin_enqueue_scripts:term',
|
1073 |
}
|
1074 |
}
|
1075 |
}
|
1036 |
}
|
1037 |
|
1038 |
public function _action_admin_enqueue_scripts() {
|
|
|
|
|
1039 |
/**
|
1040 |
* Enqueue settings options static in <head>
|
1041 |
* @see FW_Settings_Form_Theme::_action_admin_enqueue_scripts()
|
1045 |
* Enqueue post options static in <head>
|
1046 |
*/
|
1047 |
{
|
1048 |
+
if ( 'post' === get_current_screen()->base && get_the_ID() ) {
|
1049 |
fw()->backend->enqueue_options_static(
|
1050 |
+
fw()->theme->get_post_options( get_post_type() )
|
1051 |
);
|
1052 |
|
1053 |
+
do_action( 'fw_admin_enqueue_scripts:post', get_post() );
|
1054 |
}
|
1055 |
}
|
1056 |
|
1059 |
*/
|
1060 |
{
|
1061 |
if (
|
1062 |
+
in_array(get_current_screen()->base, array('edit-tags', 'term'), true)
|
1063 |
&&
|
1064 |
+
get_current_screen()->taxonomy
|
1065 |
) {
|
1066 |
fw()->backend->enqueue_options_static(
|
1067 |
+
fw()->theme->get_taxonomy_options( get_current_screen()->taxonomy )
|
1068 |
);
|
1069 |
|
1070 |
+
do_action( 'fw_admin_enqueue_scripts:term', get_current_screen()->taxonomy );
|
1071 |
}
|
1072 |
}
|
1073 |
}
|
framework/core/components/extensions/manager/class--fw-extensions-manager.php
CHANGED
@@ -93,6 +93,10 @@ final class _FW_Extensions_Manager
|
|
93 |
*/
|
94 |
public function can_activate()
|
95 |
{
|
|
|
|
|
|
|
|
|
96 |
$can_activate = current_user_can('manage_options');
|
97 |
|
98 |
if ($can_activate) {
|
@@ -116,6 +120,10 @@ final class _FW_Extensions_Manager
|
|
116 |
*/
|
117 |
public function can_install()
|
118 |
{
|
|
|
|
|
|
|
|
|
119 |
$capability = 'install_plugins';
|
120 |
|
121 |
if (is_multisite()) {
|
93 |
*/
|
94 |
public function can_activate()
|
95 |
{
|
96 |
+
if ( fw_is_cli() ) {
|
97 |
+
return true;
|
98 |
+
}
|
99 |
+
|
100 |
$can_activate = current_user_can('manage_options');
|
101 |
|
102 |
if ($can_activate) {
|
120 |
*/
|
121 |
public function can_install()
|
122 |
{
|
123 |
+
if ( fw_is_cli() ) {
|
124 |
+
return true;
|
125 |
+
}
|
126 |
+
|
127 |
$capability = 'install_plugins';
|
128 |
|
129 |
if (is_multisite()) {
|
framework/core/extends/class-fw-extension.php
CHANGED
@@ -302,7 +302,7 @@ abstract class FW_Extension
|
|
302 |
FW_Cache::set($cache_key, $config);
|
303 |
}
|
304 |
|
305 |
-
return $key === null ? $config : fw_akg($key, $config);
|
306 |
}
|
307 |
|
308 |
/**
|
302 |
FW_Cache::set($cache_key, $config);
|
303 |
}
|
304 |
|
305 |
+
return $key === null ? $config : fw_call( fw_akg( $key, $config ) );
|
306 |
}
|
307 |
|
308 |
/**
|
framework/helpers/class-fw-callback.php
CHANGED
@@ -31,7 +31,7 @@ class FW_Callback {
|
|
31 |
/**
|
32 |
* FW_Callback constructor.
|
33 |
*
|
34 |
-
* @param string|array $callback Callback function
|
35 |
* @param array $args Callback arguments
|
36 |
* @param bool $cache Whenever you want to cache the function value after it's first call or not
|
37 |
* Recommend when the function call may require many resources or time (database requests) , or the value is small
|
@@ -98,20 +98,35 @@ class FW_Callback {
|
|
98 |
|
99 |
protected function get_id() {
|
100 |
if ( ! is_string( $this->id ) ) {
|
101 |
-
|
|
|
|
|
|
|
102 |
}
|
103 |
|
104 |
return $this->id;
|
105 |
}
|
106 |
|
107 |
protected function serialize_callback() {
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
}
|
31 |
/**
|
32 |
* FW_Callback constructor.
|
33 |
*
|
34 |
+
* @param string|array|Closure $callback Callback function
|
35 |
* @param array $args Callback arguments
|
36 |
* @param bool $cache Whenever you want to cache the function value after it's first call or not
|
37 |
* Recommend when the function call may require many resources or time (database requests) , or the value is small
|
98 |
|
99 |
protected function get_id() {
|
100 |
if ( ! is_string( $this->id ) ) {
|
101 |
+
//$this->id = 'fw-callback-' . md5( $this->serialize_callback() . serialize( $this->args ) );
|
102 |
+
//Disabled temporary for optimization reasons
|
103 |
+
//Maybe later will come with a better idea.
|
104 |
+
$this->id = uniqid( 'fw-callback-' );
|
105 |
}
|
106 |
|
107 |
return $this->id;
|
108 |
}
|
109 |
|
110 |
protected function serialize_callback() {
|
111 |
+
|
112 |
+
if ( is_string( $this->callback ) ) {
|
113 |
+
return $this->callback;
|
114 |
+
}
|
115 |
+
|
116 |
+
if ( is_object( $this->callback ) ) {
|
117 |
+
return spl_object_hash( $this->callback );
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( is_array( $this->callback ) ) {
|
121 |
+
$callback = $this->callback;
|
122 |
+
|
123 |
+
if ( is_object( ( $first = array_shift( $callback ) ) ) ) {
|
124 |
+
return spl_object_hash( $first ) . serialize( $callback );
|
125 |
+
}
|
126 |
+
|
127 |
+
return serialize( $this->callback );
|
128 |
+
}
|
129 |
+
|
130 |
+
return uniqid();
|
131 |
}
|
132 |
}
|
framework/helpers/class-fw-db-options-model.php
CHANGED
@@ -135,17 +135,23 @@ abstract class FW_Db_Options_Model {
|
|
135 |
*/
|
136 |
if ( ! is_null($default_value) ) {
|
137 |
if ( empty( $option_id ) ) {
|
138 |
-
if ( empty( $values )
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
} else {
|
142 |
if ( is_null( $sub_keys ) ) {
|
143 |
if ( ! isset( $values[ $option_id ] ) ) {
|
144 |
-
return $default_value;
|
145 |
}
|
146 |
} else {
|
147 |
if ( ! isset($values[ $option_id ]) || is_null( fw_akg( $sub_keys, $values[ $option_id ] ) ) ) {
|
148 |
-
return $default_value;
|
149 |
}
|
150 |
}
|
151 |
}
|
@@ -209,16 +215,18 @@ abstract class FW_Db_Options_Model {
|
|
209 |
}
|
210 |
|
211 |
if (empty($option_id)) {
|
212 |
-
return (empty($values) && is_array($default_value)
|
|
|
|
|
213 |
} else {
|
214 |
if (is_null($sub_keys)) {
|
215 |
return isset($values[$option_id])
|
216 |
? $values[$option_id]
|
217 |
-
: $default_value;
|
218 |
} else {
|
219 |
return isset($values[$option_id])
|
220 |
? fw_akg($sub_keys, $values[$option_id], $default_value)
|
221 |
-
: $default_value;
|
222 |
}
|
223 |
}
|
224 |
}
|
135 |
*/
|
136 |
if ( ! is_null($default_value) ) {
|
137 |
if ( empty( $option_id ) ) {
|
138 |
+
if ( empty( $values )
|
139 |
+
&& (
|
140 |
+
is_array( $default_value )
|
141 |
+
||
|
142 |
+
fw_is_callback( is_array( $default_value ) )
|
143 |
+
)
|
144 |
+
) {
|
145 |
+
return fw_call( $default_value );
|
146 |
}
|
147 |
} else {
|
148 |
if ( is_null( $sub_keys ) ) {
|
149 |
if ( ! isset( $values[ $option_id ] ) ) {
|
150 |
+
return fw_call( $default_value );
|
151 |
}
|
152 |
} else {
|
153 |
if ( ! isset($values[ $option_id ]) || is_null( fw_akg( $sub_keys, $values[ $option_id ] ) ) ) {
|
154 |
+
return fw_call( $default_value );
|
155 |
}
|
156 |
}
|
157 |
}
|
215 |
}
|
216 |
|
217 |
if (empty($option_id)) {
|
218 |
+
return ( empty( $values ) && ( is_array( $default_value ) || fw_is_callback( $default_value ) ) )
|
219 |
+
? fw_call( $default_value )
|
220 |
+
: $values;
|
221 |
} else {
|
222 |
if (is_null($sub_keys)) {
|
223 |
return isset($values[$option_id])
|
224 |
? $values[$option_id]
|
225 |
+
: fw_call( $default_value );
|
226 |
} else {
|
227 |
return isset($values[$option_id])
|
228 |
? fw_akg($sub_keys, $values[$option_id], $default_value)
|
229 |
+
: fw_call( $default_value );
|
230 |
}
|
231 |
}
|
232 |
}
|
framework/helpers/class-fw-wp-option.php
CHANGED
@@ -24,7 +24,7 @@ class FW_WP_Option
|
|
24 |
$value = get_option($option_name, null);
|
25 |
|
26 |
if (empty($specific_multi_key) && $specific_multi_key !== '0') {
|
27 |
-
return is_null($value) ? $default_value : $value;
|
28 |
} else {
|
29 |
return fw_akg($specific_multi_key, $value, $default_value);
|
30 |
}
|
24 |
$value = get_option($option_name, null);
|
25 |
|
26 |
if (empty($specific_multi_key) && $specific_multi_key !== '0') {
|
27 |
+
return is_null($value) ? fw_call( $default_value ) : $value;
|
28 |
} else {
|
29 |
return fw_akg($specific_multi_key, $value, $default_value);
|
30 |
}
|
framework/helpers/general.php
CHANGED
@@ -191,18 +191,18 @@ function fw_akg( $keys, $array_or_object, $default_value = null, $keys_delimiter
|
|
191 |
|
192 |
$key_or_property = array_shift( $keys );
|
193 |
if ( $key_or_property === null ) {
|
194 |
-
return $default_value;
|
195 |
}
|
196 |
|
197 |
$is_object = is_object( $array_or_object );
|
198 |
|
199 |
if ( $is_object ) {
|
200 |
if ( ! property_exists( $array_or_object, $key_or_property ) ) {
|
201 |
-
return $default_value;
|
202 |
}
|
203 |
} else {
|
204 |
if ( ! is_array( $array_or_object ) || ! array_key_exists( $key_or_property, $array_or_object ) ) {
|
205 |
-
return $default_value;
|
206 |
}
|
207 |
}
|
208 |
|
@@ -228,6 +228,8 @@ function fw_akg( $keys, $array_or_object, $default_value = null, $keys_delimiter
|
|
228 |
* @param mixed $value
|
229 |
* @param array|object $array_or_object
|
230 |
* @param string $keys_delimiter
|
|
|
|
|
231 |
*/
|
232 |
function fw_aks( $keys, $value, &$array_or_object, $keys_delimiter = '/' ) {
|
233 |
if ( ! is_array( $keys ) ) {
|
@@ -236,7 +238,7 @@ function fw_aks( $keys, $value, &$array_or_object, $keys_delimiter = '/' ) {
|
|
236 |
|
237 |
$key_or_property = array_shift( $keys );
|
238 |
if ( $key_or_property === null ) {
|
239 |
-
return;
|
240 |
}
|
241 |
|
242 |
$is_object = is_object( $array_or_object );
|
@@ -286,6 +288,8 @@ function fw_aks( $keys, $value, &$array_or_object, $keys_delimiter = '/' ) {
|
|
286 |
$array_or_object[ $key_or_property ] = $value;
|
287 |
}
|
288 |
}
|
|
|
|
|
289 |
}
|
290 |
|
291 |
/**
|
@@ -294,6 +298,8 @@ function fw_aks( $keys, $value, &$array_or_object, $keys_delimiter = '/' ) {
|
|
294 |
* @param string $keys 'a/b/c' -> unset($arr['a']['b']['c']);
|
295 |
* @param array|object $array_or_object
|
296 |
* @param string $keys_delimiter
|
|
|
|
|
297 |
*/
|
298 |
function fw_aku( $keys, &$array_or_object, $keys_delimiter = '/' ) {
|
299 |
if ( ! is_array( $keys ) ) {
|
@@ -302,18 +308,18 @@ function fw_aku( $keys, &$array_or_object, $keys_delimiter = '/' ) {
|
|
302 |
|
303 |
$key_or_property = array_shift( $keys );
|
304 |
if ( $key_or_property === null || $key_or_property === '' ) {
|
305 |
-
return;
|
306 |
}
|
307 |
|
308 |
$is_object = is_object( $array_or_object );
|
309 |
|
310 |
if ( $is_object ) {
|
311 |
if ( ! property_exists( $array_or_object, $key_or_property ) ) {
|
312 |
-
return;
|
313 |
}
|
314 |
} else {
|
315 |
if ( ! is_array( $array_or_object ) || ! array_key_exists( $key_or_property, $array_or_object ) ) {
|
316 |
-
return;
|
317 |
}
|
318 |
}
|
319 |
|
@@ -329,9 +335,9 @@ function fw_aku( $keys, &$array_or_object, $keys_delimiter = '/' ) {
|
|
329 |
} else {
|
330 |
unset( $array_or_object[ $key_or_property ] );
|
331 |
}
|
332 |
-
|
333 |
-
return;
|
334 |
}
|
|
|
|
|
335 |
}
|
336 |
|
337 |
/**
|
@@ -1311,7 +1317,14 @@ function fw_current_url() {
|
|
1311 |
if ( $url === null ) {
|
1312 |
$url = 'http://';
|
1313 |
|
1314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1315 |
$url .= $_SERVER['HTTP_HOST'];
|
1316 |
} else {
|
1317 |
$url .= $_SERVER['SERVER_NAME'];
|
@@ -1379,7 +1392,7 @@ function fw_current_user_can( $capabilities, $default_value = null ) {
|
|
1379 |
}
|
1380 |
}
|
1381 |
|
1382 |
-
return ( $default_value !== null ? $default_value : array_shift( $capabilities ) );
|
1383 |
}
|
1384 |
|
1385 |
/**
|
@@ -1948,9 +1961,32 @@ function fw_callback( $callback, array $args = array(), $cache = true ) {
|
|
1948 |
* @since 2.6.14
|
1949 |
*/
|
1950 |
function fw_call( $value ) {
|
1951 |
-
if ( $value
|
1952 |
-
return $value
|
1953 |
}
|
1954 |
|
1955 |
-
return $value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1956 |
}
|
191 |
|
192 |
$key_or_property = array_shift( $keys );
|
193 |
if ( $key_or_property === null ) {
|
194 |
+
return fw_call( $default_value );
|
195 |
}
|
196 |
|
197 |
$is_object = is_object( $array_or_object );
|
198 |
|
199 |
if ( $is_object ) {
|
200 |
if ( ! property_exists( $array_or_object, $key_or_property ) ) {
|
201 |
+
return fw_call( $default_value );
|
202 |
}
|
203 |
} else {
|
204 |
if ( ! is_array( $array_or_object ) || ! array_key_exists( $key_or_property, $array_or_object ) ) {
|
205 |
+
return fw_call( $default_value );
|
206 |
}
|
207 |
}
|
208 |
|
228 |
* @param mixed $value
|
229 |
* @param array|object $array_or_object
|
230 |
* @param string $keys_delimiter
|
231 |
+
*
|
232 |
+
* @return array|object
|
233 |
*/
|
234 |
function fw_aks( $keys, $value, &$array_or_object, $keys_delimiter = '/' ) {
|
235 |
if ( ! is_array( $keys ) ) {
|
238 |
|
239 |
$key_or_property = array_shift( $keys );
|
240 |
if ( $key_or_property === null ) {
|
241 |
+
return $array_or_object;
|
242 |
}
|
243 |
|
244 |
$is_object = is_object( $array_or_object );
|
288 |
$array_or_object[ $key_or_property ] = $value;
|
289 |
}
|
290 |
}
|
291 |
+
|
292 |
+
return $array_or_object;
|
293 |
}
|
294 |
|
295 |
/**
|
298 |
* @param string $keys 'a/b/c' -> unset($arr['a']['b']['c']);
|
299 |
* @param array|object $array_or_object
|
300 |
* @param string $keys_delimiter
|
301 |
+
*
|
302 |
+
* @return array|object
|
303 |
*/
|
304 |
function fw_aku( $keys, &$array_or_object, $keys_delimiter = '/' ) {
|
305 |
if ( ! is_array( $keys ) ) {
|
308 |
|
309 |
$key_or_property = array_shift( $keys );
|
310 |
if ( $key_or_property === null || $key_or_property === '' ) {
|
311 |
+
return $array_or_object;
|
312 |
}
|
313 |
|
314 |
$is_object = is_object( $array_or_object );
|
315 |
|
316 |
if ( $is_object ) {
|
317 |
if ( ! property_exists( $array_or_object, $key_or_property ) ) {
|
318 |
+
return $array_or_object;
|
319 |
}
|
320 |
} else {
|
321 |
if ( ! is_array( $array_or_object ) || ! array_key_exists( $key_or_property, $array_or_object ) ) {
|
322 |
+
return $array_or_object;
|
323 |
}
|
324 |
}
|
325 |
|
335 |
} else {
|
336 |
unset( $array_or_object[ $key_or_property ] );
|
337 |
}
|
|
|
|
|
338 |
}
|
339 |
+
|
340 |
+
return $array_or_object;
|
341 |
}
|
342 |
|
343 |
/**
|
1317 |
if ( $url === null ) {
|
1318 |
$url = 'http://';
|
1319 |
|
1320 |
+
//https://github.com/ThemeFuse/Unyson/issues/2442
|
1321 |
+
$server_wildcard_or_regex = preg_match( '/(^~\^|^\*\.|\.\*$)/', $_SERVER['SERVER_NAME'] );
|
1322 |
+
|
1323 |
+
if (
|
1324 |
+
$_SERVER['SERVER_NAME'] === '_'
|
1325 |
+
||
|
1326 |
+
1 === $server_wildcard_or_regex
|
1327 |
+
) { // https://github.com/ThemeFuse/Unyson/issues/126
|
1328 |
$url .= $_SERVER['HTTP_HOST'];
|
1329 |
} else {
|
1330 |
$url .= $_SERVER['SERVER_NAME'];
|
1392 |
}
|
1393 |
}
|
1394 |
|
1395 |
+
return ( $default_value !== null ? fw_call( $default_value ) : array_shift( $capabilities ) );
|
1396 |
}
|
1397 |
|
1398 |
/**
|
1961 |
* @since 2.6.14
|
1962 |
*/
|
1963 |
function fw_call( $value ) {
|
1964 |
+
if ( ! fw_is_callback( $value ) ) {
|
1965 |
+
return $value;
|
1966 |
}
|
1967 |
|
1968 |
+
return ( is_object( $value ) && get_class( $value ) == 'Closure' )
|
1969 |
+
? $value()
|
1970 |
+
: $value->execute();
|
1971 |
+
}
|
1972 |
+
|
1973 |
+
/**
|
1974 |
+
* Check is the current value is instance of FW_Callback class
|
1975 |
+
*
|
1976 |
+
* @param mixed $value
|
1977 |
+
*
|
1978 |
+
* @return bool
|
1979 |
+
*/
|
1980 |
+
function fw_is_callback( $value ) {
|
1981 |
+
return $value instanceof FW_Callback || ( is_object( $value ) && get_class( $value ) == 'Closure' );
|
1982 |
+
}
|
1983 |
+
|
1984 |
+
/**
|
1985 |
+
* Check for command line interface
|
1986 |
+
*
|
1987 |
+
* @return bool
|
1988 |
+
* @since 2.6.16
|
1989 |
+
*/
|
1990 |
+
function fw_is_cli() {
|
1991 |
+
return ( php_sapi_name() === 'cli' ) && defined( 'WP_CLI' );
|
1992 |
}
|
framework/includes/hooks.php
CHANGED
@@ -356,4 +356,26 @@ add_filter( 'fw_github_api_url', '_fw_filter_github_api_url' );
|
|
356 |
|
357 |
add_action( 'delete_attachment', 'fw_delete_resized_thumbnails' );
|
358 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
}
|
356 |
|
357 |
add_action( 'delete_attachment', 'fw_delete_resized_thumbnails' );
|
358 |
}
|
359 |
+
}
|
360 |
+
|
361 |
+
//WPML Hooks
|
362 |
+
{
|
363 |
+
if ( is_admin() ) {
|
364 |
+
add_action( 'icl_save_term_translation', '_fw_action_wpml_duplicate_term_options', 20, 2 );
|
365 |
+
function _fw_action_wpml_duplicate_term_options( $original, $translated ) {
|
366 |
+
$original_options = fw_get_db_term_option(
|
367 |
+
fw_akg( 'term_id', $original ),
|
368 |
+
fw_akg( 'taxonomy', $original )
|
369 |
+
);
|
370 |
+
|
371 |
+
if ( $original_options !== null ) {
|
372 |
+
fw_set_db_term_option(
|
373 |
+
fw_akg( 'term_id', $translated ),
|
374 |
+
fw_akg( 'taxonomy', $original ),
|
375 |
+
null,
|
376 |
+
$original_options
|
377 |
+
);
|
378 |
+
}
|
379 |
+
}
|
380 |
+
}
|
381 |
}
|
framework/manifest.php
CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
|
|
4 |
|
5 |
$manifest['name'] = __('Unyson', 'fw');
|
6 |
|
7 |
-
$manifest['version'] = '2.6.
|
4 |
|
5 |
$manifest['name'] = __('Unyson', 'fw');
|
6 |
|
7 |
+
$manifest['version'] = '2.6.16';
|
framework/static/js/fw.js
CHANGED
@@ -945,6 +945,15 @@ fw.getQueryString = function(name) {
|
|
945 |
open: function() {
|
946 |
this.frame.open();
|
947 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
948 |
return this;
|
949 |
},
|
950 |
close: function() {
|
@@ -1258,7 +1267,7 @@ fw.getValuesFromServer = function (data) {
|
|
1258 |
}
|
1259 |
),
|
1260 |
initialize: function () {
|
1261 |
-
fw.Modal.prototype.initialize.
|
1262 |
|
1263 |
// Forward events to fwEvents
|
1264 |
{
|
945 |
open: function() {
|
946 |
this.frame.open();
|
947 |
|
948 |
+
var modal = this;
|
949 |
+
|
950 |
+
this.once('closing', function () {
|
951 |
+
fwEvents.trigger(
|
952 |
+
'fw:options:teardown',
|
953 |
+
{ $elements: modal.content.$el, modal: modal }
|
954 |
+
);
|
955 |
+
});
|
956 |
+
|
957 |
return this;
|
958 |
},
|
959 |
close: function() {
|
1267 |
}
|
1268 |
),
|
1269 |
initialize: function () {
|
1270 |
+
fw.Modal.prototype.initialize.apply(this, arguments);
|
1271 |
|
1272 |
// Forward events to fwEvents
|
1273 |
{
|
framework/views/backend-settings-form.php
CHANGED
@@ -295,6 +295,7 @@
|
|
295 |
elements.$form.css('transition', 'opacity ease .3s');
|
296 |
elements.$form.css('opacity', '0');
|
297 |
elements.$form.trigger('fw:settings-form:before-html-reset');
|
|
|
298 |
|
299 |
setTimeout(function() {
|
300 |
var scrollTop = jQuery(window).scrollTop();
|
295 |
elements.$form.css('transition', 'opacity ease .3s');
|
296 |
elements.$form.css('opacity', '0');
|
297 |
elements.$form.trigger('fw:settings-form:before-html-reset');
|
298 |
+
fwEvents.trigger('fw:options:teardown', {$elements: elements.$form});
|
299 |
|
300 |
setTimeout(function() {
|
301 |
var scrollTop = jQuery(window).scrollTop();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: unyson
|
|
3 |
Tags: page builder, shortcodes, backup, seo, breadcrumbs, portfolio, framework
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag: 2.6.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -85,6 +85,9 @@ Yes; Unyson will work with any theme.
|
|
85 |
|
86 |
== Changelog ==
|
87 |
|
|
|
|
|
|
|
88 |
= 2.6.15 =
|
89 |
* Fixed [#2380](https://github.com/ThemeFuse/Unyson/issues/2380), [#2397](https://github.com/ThemeFuse/Unyson/issues/2397), [#2212](https://github.com/ThemeFuse/Unyson/issues/2212#issuecomment-278954170)
|
90 |
|
3 |
Tags: page builder, shortcodes, backup, seo, breadcrumbs, portfolio, framework
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 2.6.16
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 2.6.16 =
|
89 |
+
* Fixed [#2490](https://github.com/ThemeFuse/Unyson/issues/2490), [#2450](https://github.com/ThemeFuse/Unyson/issues/2450), [#326](https://github.com/ThemeFuse/Unyson/issues/326)
|
90 |
+
|
91 |
= 2.6.15 =
|
92 |
* Fixed [#2380](https://github.com/ThemeFuse/Unyson/issues/2380), [#2397](https://github.com/ThemeFuse/Unyson/issues/2397), [#2212](https://github.com/ThemeFuse/Unyson/issues/2212#issuecomment-278954170)
|
93 |
|
unyson.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Unyson
|
4 |
* Plugin URI: http://unyson.io/
|
5 |
* Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
|
6 |
-
* Version: 2.6.
|
7 |
* Author: ThemeFuse
|
8 |
* Author URI: http://themefuse.com
|
9 |
* License: GPL2+
|
3 |
* Plugin Name: Unyson
|
4 |
* Plugin URI: http://unyson.io/
|
5 |
* Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
|
6 |
+
* Version: 2.6.16
|
7 |
* Author: ThemeFuse
|
8 |
* Author URI: http://themefuse.com
|
9 |
* License: GPL2+
|