Version Description
(Jan 09, 2021) = * [Added] Added alignment option to the sub-menu in the primary menu widget. * [Bug-Fix] The element pagelayer-id has been further improved to fix ModSecurity issues. * [Bug-Fix] In the primary menu widget the sub-menu alignment was not working properly. This is fixed. * [Bug-Fix] In some cases the undo-redo actions was not working properly. This is fixed.
Download this release
Release Info
Developer | pagelayer |
Plugin | Page Builder: PageLayer – Drag and Drop website builder |
Version | 1.4.3 |
Comparing to | |
See all releases |
Code changes from version 1.4.2 to 1.4.3
- css/combined.css +3 -3
- css/pagelayer-frontend.css +3 -3
- init.php +13 -8
- js/pagelayer-editor.js +42 -12
- js/properties.js +24 -4
- languages/en.json +2 -1
- main/ajax.php +3 -1
- main/functions.php +8 -2
- main/import.php +35 -4
- main/shortcode_functions.php +7 -4
- main/website.php +3 -0
- pagelayer.php +1 -1
- readme.txt +7 -1
css/combined.css
CHANGED
@@ -3095,9 +3095,9 @@ padding-right:5px;
|
|
3095 |
width:auto;
|
3096 |
}
|
3097 |
|
3098 |
-
.pagelayer-wp-menu-container[data-align="right"] .pagelayer-wp_menu-ul a{justify-content: flex-end;}
|
3099 |
-
.pagelayer-wp-menu-container[data-align="left"] .pagelayer-wp_menu-ul a{justify-content: left;}
|
3100 |
-
.pagelayer-wp-menu-container[data-align="center"] .pagelayer-wp_menu-ul a{justify-content: center;}
|
3101 |
|
3102 |
.pagelayer-wp-menu-container ul li span.after-icon:before{
|
3103 |
position:absolute;
|
3095 |
width:auto;
|
3096 |
}
|
3097 |
|
3098 |
+
.pagelayer-wp-menu-container[data-align="right"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: flex-end;}
|
3099 |
+
.pagelayer-wp-menu-container[data-align="left"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: left;}
|
3100 |
+
.pagelayer-wp-menu-container[data-align="center"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: center;}
|
3101 |
|
3102 |
.pagelayer-wp-menu-container ul li span.after-icon:before{
|
3103 |
position:absolute;
|
css/pagelayer-frontend.css
CHANGED
@@ -3095,9 +3095,9 @@ padding-right:5px;
|
|
3095 |
width:auto;
|
3096 |
}
|
3097 |
|
3098 |
-
.pagelayer-wp-menu-container[data-align="right"] .pagelayer-wp_menu-ul a{justify-content: flex-end;}
|
3099 |
-
.pagelayer-wp-menu-container[data-align="left"] .pagelayer-wp_menu-ul a{justify-content: left;}
|
3100 |
-
.pagelayer-wp-menu-container[data-align="center"] .pagelayer-wp_menu-ul a{justify-content: center;}
|
3101 |
|
3102 |
.pagelayer-wp-menu-container ul li span.after-icon:before{
|
3103 |
position:absolute;
|
3095 |
width:auto;
|
3096 |
}
|
3097 |
|
3098 |
+
.pagelayer-wp-menu-container[data-align="right"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: flex-end;}
|
3099 |
+
.pagelayer-wp-menu-container[data-align="left"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: left;}
|
3100 |
+
.pagelayer-wp-menu-container[data-align="center"] .pagelayer-wp_menu-ul ul li > ul a{justify-content: center;}
|
3101 |
|
3102 |
.pagelayer-wp-menu-container ul li span.after-icon:before{
|
3103 |
position:absolute;
|
init.php
CHANGED
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) exit;
|
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
-
define('PAGELAYER_VERSION', '1.4.
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
@@ -204,7 +204,7 @@ function pagelayer_load_plugin(){
|
|
204 |
|
205 |
// Show the getting started video option
|
206 |
$seen = get_option('pagelayer_getting_started');
|
207 |
-
if(empty($seen) &&
|
208 |
add_action('admin_notices', 'pagelayer_getting_started_notice');
|
209 |
}
|
210 |
|
@@ -265,8 +265,16 @@ function pagelayer_admin_menu() {
|
|
265 |
// Add new template
|
266 |
add_submenu_page('pagelayer', __('Add New Template'), __('Add New Template'), $capability, 'pagelayer_template_wizard', 'pagelayer_builder_template_wizard');
|
267 |
|
268 |
-
// Export
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
// Getting Started
|
272 |
add_submenu_page('pagelayer', __('Getting Started'), __('Getting Started'), $capability, 'pagelayer_getting_started', 'pagelayer_getting_started');
|
@@ -282,9 +290,6 @@ function pagelayer_admin_menu() {
|
|
282 |
// License Page
|
283 |
add_submenu_page('pagelayer', __('Pagelayer Editor'), __('License'), $capability, 'pagelayer_license', 'pagelayer_license_page');
|
284 |
|
285 |
-
// Import Page
|
286 |
-
add_submenu_page('admin.php', __('Import a Theme and its Templates'), __('Import Theme'), $capability, 'pagelayer_import', 'pagelayer_import_page');
|
287 |
-
|
288 |
}
|
289 |
|
290 |
// This function will handle the Settings Pages in PageLayer
|
@@ -727,7 +732,7 @@ function pagelayer_global_styles(){
|
|
727 |
$matches = [];
|
728 |
preg_match('/_(mobile|tablet)$/is', $k, $matches);
|
729 |
$key = str_replace(['_mobile', '_tablet'], '', $k);
|
730 |
-
$screen =
|
731 |
|
732 |
//echo $key.' - '.$k;pagelayer_print($matches);
|
733 |
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
+
define('PAGELAYER_VERSION', '1.4.3');
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
204 |
|
205 |
// Show the getting started video option
|
206 |
$seen = get_option('pagelayer_getting_started');
|
207 |
+
if(empty($seen) && !empty($_GET['page']) && $_GET['page'] != 'pagelayer_getting_started'){
|
208 |
add_action('admin_notices', 'pagelayer_getting_started_notice');
|
209 |
}
|
210 |
|
265 |
// Add new template
|
266 |
add_submenu_page('pagelayer', __('Add New Template'), __('Add New Template'), $capability, 'pagelayer_template_wizard', 'pagelayer_builder_template_wizard');
|
267 |
|
268 |
+
// Export Feature
|
269 |
+
if(defined('PAGELAYER_PREMIUM')){
|
270 |
+
|
271 |
+
// Export Theme
|
272 |
+
add_submenu_page('pagelayer', __('Export Content into a Theme'), __('Export Theme'), $capability, 'pagelayer_template_export', 'pagelayer_builder_export');
|
273 |
+
|
274 |
+
// Import Theme
|
275 |
+
add_submenu_page('pagelayer', __('Import content from a Theme'), __('Import Theme'), $capability, 'pagelayer_import', 'pagelayer_import_page');
|
276 |
+
|
277 |
+
}
|
278 |
|
279 |
// Getting Started
|
280 |
add_submenu_page('pagelayer', __('Getting Started'), __('Getting Started'), $capability, 'pagelayer_getting_started', 'pagelayer_getting_started');
|
290 |
// License Page
|
291 |
add_submenu_page('pagelayer', __('Pagelayer Editor'), __('License'), $capability, 'pagelayer_license', 'pagelayer_license_page');
|
292 |
|
|
|
|
|
|
|
293 |
}
|
294 |
|
295 |
// This function will handle the Settings Pages in PageLayer
|
732 |
$matches = [];
|
733 |
preg_match('/_(mobile|tablet)$/is', $k, $matches);
|
734 |
$key = str_replace(['_mobile', '_tablet'], '', $k);
|
735 |
+
$screen = @$matches[1];
|
736 |
|
737 |
//echo $key.' - '.$k;pagelayer_print($matches);
|
738 |
|
js/pagelayer-editor.js
CHANGED
@@ -1279,7 +1279,8 @@ function pagelayer_assign_id(jEle){
|
|
1279 |
// Do you have the pagelayer id
|
1280 |
var id = jEle.attr("pagelayer-id");
|
1281 |
if(!id || id.length < 1){
|
1282 |
-
id = pagelayer_randstr(
|
|
|
1283 |
jEle.attr("pagelayer-id", id);
|
1284 |
}
|
1285 |
|
@@ -1892,10 +1893,17 @@ jQuery(document).on('paste', function(pasteEvent){
|
|
1892 |
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+obj['data']['url']+'\')');
|
1893 |
|
1894 |
// To remove past temp attr so that they are not involve in future temp values
|
1895 |
-
|
|
|
|
|
1896 |
|
1897 |
for(var x in obj['data']['sizes']){
|
1898 |
_pagelayer_set_tmp_atts(row, x+'-url', obj['data']['sizes'][x]['url']);
|
|
|
|
|
|
|
|
|
|
|
1899 |
}
|
1900 |
|
1901 |
// Save and render
|
@@ -2874,6 +2882,22 @@ function pagelayer_clear_tmp_atts(jEle, attr){
|
|
2874 |
}
|
2875 |
}
|
2876 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2877 |
// Set the att and classes of an HTML which is not yet created
|
2878 |
function pagelayer_sc_atts(classes){
|
2879 |
var r = new Array();
|
@@ -4031,16 +4055,19 @@ function pagelayer_history_action_push(args){
|
|
4031 |
// If the action time within 200 millisecond then it count as sub-actions
|
4032 |
if(currentTime - pagelayer.history_lastTime < 200 && history_obj_len > 1){
|
4033 |
|
4034 |
-
var
|
4035 |
-
|
4036 |
-
// If the sub_actions_len is less then 1 then set the data in array 0 position
|
4037 |
-
if(sub_actions_len.length < 1){
|
4038 |
-
pagelayer_history_obj['action_data'][action_id]['sub_actions_group'] = [args];
|
4039 |
-
}else{
|
4040 |
-
pagelayer_history_obj['action_data'][action_id]['sub_actions_group'].push(args);
|
4041 |
-
}
|
4042 |
|
4043 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4044 |
}
|
4045 |
|
4046 |
pagelayer_history_obj['action_data'].push(args);
|
@@ -4775,6 +4802,10 @@ function pagelayer_randstr(n, special){
|
|
4775 |
return text;
|
4776 |
};
|
4777 |
|
|
|
|
|
|
|
|
|
4778 |
// Convert the regular URL of a Video to a Embed URL
|
4779 |
function pagelayer_video_url(src){
|
4780 |
|
@@ -5287,7 +5318,6 @@ function pagelayer_add_sections_list_setup(type){
|
|
5287 |
},
|
5288 |
success: function(data) {
|
5289 |
|
5290 |
-
|
5291 |
try{
|
5292 |
|
5293 |
var data = JSON.parse(data);
|
1279 |
// Do you have the pagelayer id
|
1280 |
var id = jEle.attr("pagelayer-id");
|
1281 |
if(!id || id.length < 1){
|
1282 |
+
id = pagelayer_randstr(3)+pagelayer_randInt(9999).toString();
|
1283 |
+
id = id.toLowerCase();
|
1284 |
jEle.attr("pagelayer-id", id);
|
1285 |
}
|
1286 |
|
1893 |
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+obj['data']['url']+'\')');
|
1894 |
|
1895 |
// To remove past temp attr so that they are not involve in future temp values
|
1896 |
+
var cname = row.attr('pagelayer-elp-name');
|
1897 |
+
var old = _pagelayer_img_tmp_atts(row);
|
1898 |
+
delete old[cname+'-url'];
|
1899 |
|
1900 |
for(var x in obj['data']['sizes']){
|
1901 |
_pagelayer_set_tmp_atts(row, x+'-url', obj['data']['sizes'][x]['url']);
|
1902 |
+
delete old[cname+'-'+x+'-url'];
|
1903 |
+
}
|
1904 |
+
|
1905 |
+
for(var x in old){
|
1906 |
+
_pagelayer_set_tmp_atts(row, x+'-url', '');
|
1907 |
}
|
1908 |
|
1909 |
// Save and render
|
2882 |
}
|
2883 |
}
|
2884 |
|
2885 |
+
// This function removes the temporary attributes of an ele
|
2886 |
+
function pagelayer_img_tmp_atts(jEle, attr){
|
2887 |
+
|
2888 |
+
var found = {};
|
2889 |
+
var regexp = new RegExp('^'+attr+'\-', 'gi');
|
2890 |
+
var ref_data = pagelayer_el_data_ref(jEle);
|
2891 |
+
|
2892 |
+
for(var n in ref_data['tmp']){
|
2893 |
+
if(n.match(regexp)){
|
2894 |
+
found[n] = 1;
|
2895 |
+
}
|
2896 |
+
}
|
2897 |
+
|
2898 |
+
return found;
|
2899 |
+
}
|
2900 |
+
|
2901 |
// Set the att and classes of an HTML which is not yet created
|
2902 |
function pagelayer_sc_atts(classes){
|
2903 |
var r = new Array();
|
4055 |
// If the action time within 200 millisecond then it count as sub-actions
|
4056 |
if(currentTime - pagelayer.history_lastTime < 200 && history_obj_len > 1){
|
4057 |
|
4058 |
+
var cur_action_data = pagelayer_history_obj['action_data'][action_id];
|
4059 |
+
var sub_actions_len = cur_action_data['sub_actions_group'] || '';
|
|
|
|
|
|
|
|
|
|
|
|
|
4060 |
|
4061 |
+
if( !('attrType' in cur_action_data && cur_action_data['attrType'] == 'tmp_attr' && 'attrType' in args && args['attrType'] == 'a_attr') ) {
|
4062 |
+
// If the sub_actions_len is less then 1 then set the data in array 0 position
|
4063 |
+
if(sub_actions_len.length < 1){
|
4064 |
+
pagelayer_history_obj['action_data'][action_id]['sub_actions_group'] = [args];
|
4065 |
+
}else{
|
4066 |
+
pagelayer_history_obj['action_data'][action_id]['sub_actions_group'].push(args);
|
4067 |
+
}
|
4068 |
+
|
4069 |
+
return true;
|
4070 |
+
}
|
4071 |
}
|
4072 |
|
4073 |
pagelayer_history_obj['action_data'].push(args);
|
4802 |
return text;
|
4803 |
};
|
4804 |
|
4805 |
+
function pagelayer_randInt(max) {
|
4806 |
+
return Math.floor(Math.random() * Math.floor(max));
|
4807 |
+
}
|
4808 |
+
|
4809 |
// Convert the regular URL of a Video to a Embed URL
|
4810 |
function pagelayer_video_url(src){
|
4811 |
|
5318 |
},
|
5319 |
success: function(data) {
|
5320 |
|
|
|
5321 |
try{
|
5322 |
|
5323 |
var data = JSON.parse(data);
|
js/properties.js
CHANGED
@@ -776,6 +776,13 @@ function _pagelayer_clear_tmp_atts(row){
|
|
776 |
pagelayer_clear_tmp_atts(jEle, row.attr('pagelayer-elp-name'));
|
777 |
};
|
778 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
// Get the tmp att
|
780 |
function _pagelayer_get_tmp_att(row, suffix){
|
781 |
var id = row.closest('[pagelayer-element-id]').attr('pagelayer-element-id');
|
@@ -1179,11 +1186,17 @@ function pagelayer_elp_image(row, prop){
|
|
1179 |
url = attachment.url;
|
1180 |
|
1181 |
// To remove past temp attr so that they are not involve in future temp values
|
1182 |
-
|
1183 |
-
|
|
|
1184 |
// Keep a list of all sizes
|
1185 |
for(var x in attachment.sizes){
|
1186 |
_pagelayer_set_tmp_atts(row, x+'-url', attachment.sizes[x].url);
|
|
|
|
|
|
|
|
|
|
|
1187 |
}
|
1188 |
|
1189 |
}
|
@@ -1287,12 +1300,19 @@ function pagelayer_img_dragAndDrop(dropzoneParent, dropZone, jEle, row){
|
|
1287 |
}
|
1288 |
|
1289 |
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+url+'\')');
|
1290 |
-
|
1291 |
// To remove past temp attr so that they are not involve in future temp values
|
1292 |
-
|
|
|
|
|
1293 |
|
1294 |
for(var x in obj['data']['sizes']){
|
1295 |
_pagelayer_set_tmp_atts(row, x+'-url', obj['data']['sizes'][x]['url']);
|
|
|
|
|
|
|
|
|
|
|
1296 |
}
|
1297 |
|
1298 |
dropZone.find('.pagelayer-elp-img-up-bar').css('width', '3%');
|
776 |
pagelayer_clear_tmp_atts(jEle, row.attr('pagelayer-elp-name'));
|
777 |
};
|
778 |
|
779 |
+
// Get the attribute of images only
|
780 |
+
function _pagelayer_img_tmp_atts(row){
|
781 |
+
var id = row.closest('[pagelayer-element-id]').attr('pagelayer-element-id');
|
782 |
+
var jEle = jQuery('[pagelayer-id='+id+']');
|
783 |
+
return pagelayer_img_tmp_atts(jEle, row.attr('pagelayer-elp-name'));
|
784 |
+
};
|
785 |
+
|
786 |
// Get the tmp att
|
787 |
function _pagelayer_get_tmp_att(row, suffix){
|
788 |
var id = row.closest('[pagelayer-element-id]').attr('pagelayer-element-id');
|
1186 |
url = attachment.url;
|
1187 |
|
1188 |
// To remove past temp attr so that they are not involve in future temp values
|
1189 |
+
var old = _pagelayer_img_tmp_atts(row);
|
1190 |
+
delete old[prop.c['name']+'-url'];
|
1191 |
+
|
1192 |
// Keep a list of all sizes
|
1193 |
for(var x in attachment.sizes){
|
1194 |
_pagelayer_set_tmp_atts(row, x+'-url', attachment.sizes[x].url);
|
1195 |
+
delete old[prop.c['name']+'-'+x+'-url'];
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
for(var x in old){
|
1199 |
+
_pagelayer_set_tmp_atts(row, x+'-url', '');
|
1200 |
}
|
1201 |
|
1202 |
}
|
1300 |
}
|
1301 |
|
1302 |
row.find('.pagelayer-elp-image').css('background-image', 'url(\''+url+'\')');
|
1303 |
+
|
1304 |
// To remove past temp attr so that they are not involve in future temp values
|
1305 |
+
var cname = row.attr('pagelayer-elp-name');
|
1306 |
+
var old = _pagelayer_img_tmp_atts(row);
|
1307 |
+
delete old[cname+'-url'];
|
1308 |
|
1309 |
for(var x in obj['data']['sizes']){
|
1310 |
_pagelayer_set_tmp_atts(row, x+'-url', obj['data']['sizes'][x]['url']);
|
1311 |
+
delete old[cname+'-'+x+'-url'];
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
for(var x in old){
|
1315 |
+
_pagelayer_set_tmp_atts(row, x+'-url', '');
|
1316 |
}
|
1317 |
|
1318 |
dropZone.find('.pagelayer-elp-img-up-bar').css('width', '3%');
|
languages/en.json
CHANGED
@@ -1838,5 +1838,6 @@
|
|
1838 |
"only_top_level" : "Only Top Level",
|
1839 |
"text_decoration" : "Text Decoration",
|
1840 |
"elem_styles" : "Element Styles",
|
1841 |
-
"body_style" : "Body Style"
|
|
|
1842 |
}
|
1838 |
"only_top_level" : "Only Top Level",
|
1839 |
"text_decoration" : "Text Decoration",
|
1840 |
"elem_styles" : "Element Styles",
|
1841 |
+
"body_style" : "Body Style",
|
1842 |
+
"item_alignment" : "Item Alignment"
|
1843 |
}
|
main/ajax.php
CHANGED
@@ -1178,6 +1178,7 @@ function pagelayer_get_pages_list(){
|
|
1178 |
'order' => $_POST['order'],
|
1179 |
'hierarchical' => (empty($_POST['hier']) || $_POST['hier'] == null ? '' : $_POST['hier']),
|
1180 |
'number' => (empty($_POST['depth']) || $_POST['depth'] == null ? '' : $_POST['depth']),
|
|
|
1181 |
);
|
1182 |
|
1183 |
$option = '<ul>';
|
@@ -1707,7 +1708,8 @@ function pagelayer_export_template(){
|
|
1707 |
$_query = new WP_Query([
|
1708 |
'post_type' => $type,
|
1709 |
'status' => 'publish',
|
1710 |
-
'post__in' => $pids
|
|
|
1711 |
]);
|
1712 |
|
1713 |
$posts = $_query->posts;
|
1178 |
'order' => $_POST['order'],
|
1179 |
'hierarchical' => (empty($_POST['hier']) || $_POST['hier'] == null ? '' : $_POST['hier']),
|
1180 |
'number' => (empty($_POST['depth']) || $_POST['depth'] == null ? '' : $_POST['depth']),
|
1181 |
+
'posts_per_page' => -1,
|
1182 |
);
|
1183 |
|
1184 |
$option = '<ul>';
|
1708 |
$_query = new WP_Query([
|
1709 |
'post_type' => $type,
|
1710 |
'status' => 'publish',
|
1711 |
+
'post__in' => $pids,
|
1712 |
+
'posts_per_page' => -1,
|
1713 |
]);
|
1714 |
|
1715 |
$posts = $_query->posts;
|
main/functions.php
CHANGED
@@ -583,6 +583,10 @@ function pagelayer_the_content($content){
|
|
583 |
return $content;
|
584 |
}
|
585 |
|
|
|
|
|
|
|
|
|
586 |
// Loads the shortcodes
|
587 |
function pagelayer_load_shortcodes(){
|
588 |
global $pagelayer;
|
@@ -2002,8 +2006,6 @@ function pagelayer_export_content($content){
|
|
2002 |
$theme_url = preg_replace('/http(s?):\/\//is', '', get_stylesheet_directory_uri());
|
2003 |
|
2004 |
$content = preg_replace('/http(s?):\/\/'.preg_quote($theme_url, '/').'/is', '{{theme_url}}', $content);
|
2005 |
-
$content = str_replace('<!-- wp:pagelayer', '<!-- sp:pagelayer', $content);
|
2006 |
-
$content = str_replace('<!-- /wp:pagelayer', '<!-- /sp:pagelayer', $content);
|
2007 |
|
2008 |
// Remove unnecessary spaces
|
2009 |
$content = preg_replace('/--\>\s*(?!<!--)/is', '-->', $content);
|
@@ -2036,6 +2038,10 @@ function pagelayer_export_content($content){
|
|
2036 |
// Reserialize
|
2037 |
$content = serialize_blocks($parsed);
|
2038 |
|
|
|
|
|
|
|
|
|
2039 |
// Just pass the content to
|
2040 |
$content = pagelayer_export_extract_menu_ids($content);
|
2041 |
|
583 |
return $content;
|
584 |
}
|
585 |
|
586 |
+
function pagelayer_create_id(){
|
587 |
+
return pagelayer_RandomString(3).rand(1000, 9999);
|
588 |
+
}
|
589 |
+
|
590 |
// Loads the shortcodes
|
591 |
function pagelayer_load_shortcodes(){
|
592 |
global $pagelayer;
|
2006 |
$theme_url = preg_replace('/http(s?):\/\//is', '', get_stylesheet_directory_uri());
|
2007 |
|
2008 |
$content = preg_replace('/http(s?):\/\/'.preg_quote($theme_url, '/').'/is', '{{theme_url}}', $content);
|
|
|
|
|
2009 |
|
2010 |
// Remove unnecessary spaces
|
2011 |
$content = preg_replace('/--\>\s*(?!<!--)/is', '-->', $content);
|
2038 |
// Reserialize
|
2039 |
$content = serialize_blocks($parsed);
|
2040 |
|
2041 |
+
// We store in SP format
|
2042 |
+
$content = str_replace('<!-- wp:pagelayer', '<!-- sp:pagelayer', $content);
|
2043 |
+
$content = str_replace('<!-- /wp:pagelayer', '<!-- /sp:pagelayer', $content);
|
2044 |
+
|
2045 |
// Just pass the content to
|
2046 |
$content = pagelayer_export_extract_menu_ids($content);
|
2047 |
|
main/import.php
CHANGED
@@ -49,8 +49,6 @@ function pagelayer_import(){
|
|
49 |
$GLOBALS['pl_warn'] = __('You have already imported the content of this theme. You can re-import the same by either choosing to over-write existing pages / pagelayer templates OR creating duplicate content !', 'pagelayer');
|
50 |
}
|
51 |
|
52 |
-
|
53 |
-
|
54 |
// Call the theme
|
55 |
pagelayer_import_T();
|
56 |
|
@@ -82,6 +80,12 @@ function pagelayer_import_T(){
|
|
82 |
die();
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
echo '
|
86 |
<style>
|
87 |
.pagelayer_img_screen{
|
@@ -191,6 +195,7 @@ font-weight: 600;
|
|
191 |
<form id="pagelayer-import-form" method="post" enctype="multipart/form-data">';
|
192 |
wp_nonce_field('pagelayer-import');
|
193 |
echo '<input name="theme" value="'.get_template().'" type="hidden" />
|
|
|
194 |
<div><input type="checkbox" name="delete_old_import" id="delete_old_import" /> Delete Previously Imported Content</div>
|
195 |
<div><input type="checkbox" name="overwrite" /> Overwrite existing Pages with same name</div>
|
196 |
<div><input type="checkbox" name="set_home_page" checked /> Set the Home Page as per the content</div>
|
@@ -274,14 +279,21 @@ jQuery(document).ready(function(){
|
|
274 |
<div style="margin: 0px -10px; vertical-align: top;">
|
275 |
<div style="width: 52%; display: inline-block; text-align: center;">
|
276 |
<div style="width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
|
277 |
-
<img id="pagelayer_display_image" src="'.$
|
278 |
</div>
|
279 |
</div>
|
280 |
<div style="width: 45%; display: inline-block; padding: 0px 10px; vertical-align: top;">';
|
281 |
|
282 |
foreach($pagelayer_pages['page'] as $k => $v){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
echo '<div class="pagelayer_img_screen" page="'.$k.'">
|
284 |
-
<div class="pagelayer_img_div"><img src="'.$
|
285 |
<div class="pagelayer_img_name">'.$v['post_title'].'</div>
|
286 |
</div>';
|
287 |
}
|
@@ -983,6 +995,10 @@ function pagelayer_import_create_menu($name){
|
|
983 |
function pagelayer_import_handle_replaces($content){
|
984 |
global $pagelayer;
|
985 |
|
|
|
|
|
|
|
|
|
986 |
foreach($pagelayer->imported_menus_preg as $k => $v){
|
987 |
$content = preg_replace('/\[pl_wp_menu ([^\]]*)nav_list="'.$k.'"([^\]]*)\]/is', '[pl_wp_menu ${1}nav_list="'.$v.'"${3}]', $content);
|
988 |
}
|
@@ -1082,6 +1098,7 @@ function pagelayer_import_update_menus($menu_id, $pagelayer_theme_path = ''){
|
|
1082 |
$r['menu-item-status'] = $v['post']['post_status'];
|
1083 |
$r['menu-item-type'] = $v['post']['type'];
|
1084 |
$r['menu-item-object'] = $v['post']['object'];
|
|
|
1085 |
|
1086 |
// Any parent ?
|
1087 |
if(!empty($v['post']['menu_item_parent'])){
|
@@ -1140,6 +1157,20 @@ function pagelayer_handle_wp_menu($matches){
|
|
1140 |
|
1141 |
}
|
1142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1143 |
// Replace Social URLs with the one given in setup
|
1144 |
function pagelayer_handle_social_urls($matches){
|
1145 |
//r_print($matches);die();
|
49 |
$GLOBALS['pl_warn'] = __('You have already imported the content of this theme. You can re-import the same by either choosing to over-write existing pages / pagelayer templates OR creating duplicate content !', 'pagelayer');
|
50 |
}
|
51 |
|
|
|
|
|
52 |
// Call the theme
|
53 |
pagelayer_import_T();
|
54 |
|
80 |
die();
|
81 |
}
|
82 |
|
83 |
+
// Home screenshot
|
84 |
+
$screenshot = $pagelayer_theme_url.'/screenshots/home.jpg';
|
85 |
+
if(!file_exists($pagelayer_theme_path.'/screenshots/home.jpg')){
|
86 |
+
$screenshot = PAGELAYER_URL.'/images/no_screenshot.png';
|
87 |
+
}
|
88 |
+
|
89 |
echo '
|
90 |
<style>
|
91 |
.pagelayer_img_screen{
|
195 |
<form id="pagelayer-import-form" method="post" enctype="multipart/form-data">';
|
196 |
wp_nonce_field('pagelayer-import');
|
197 |
echo '<input name="theme" value="'.get_template().'" type="hidden" />
|
198 |
+
<div><input type="checkbox" name="no_header_menu" /> Do not create Header Menu</div>
|
199 |
<div><input type="checkbox" name="delete_old_import" id="delete_old_import" /> Delete Previously Imported Content</div>
|
200 |
<div><input type="checkbox" name="overwrite" /> Overwrite existing Pages with same name</div>
|
201 |
<div><input type="checkbox" name="set_home_page" checked /> Set the Home Page as per the content</div>
|
279 |
<div style="margin: 0px -10px; vertical-align: top;">
|
280 |
<div style="width: 52%; display: inline-block; text-align: center;">
|
281 |
<div style="width: 100%; max-height: 400px; overflow: auto; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
|
282 |
+
<img id="pagelayer_display_image" src="'.$screenshot.'" width="100%">
|
283 |
</div>
|
284 |
</div>
|
285 |
<div style="width: 45%; display: inline-block; padding: 0px 10px; vertical-align: top;">';
|
286 |
|
287 |
foreach($pagelayer_pages['page'] as $k => $v){
|
288 |
+
|
289 |
+
$screenshot = $pagelayer_theme_url.'/screenshots/'.$k.'.jpg';
|
290 |
+
|
291 |
+
if(!file_exists($pagelayer_theme_path.'/screenshots/'.$k.'.jpg')){
|
292 |
+
$screenshot = PAGELAYER_URL.'/images/no_screenshot.png';
|
293 |
+
}
|
294 |
+
|
295 |
echo '<div class="pagelayer_img_screen" page="'.$k.'">
|
296 |
+
<div class="pagelayer_img_div"><img src="'.$screenshot.'" width="100%" /></div>
|
297 |
<div class="pagelayer_img_name">'.$v['post_title'].'</div>
|
298 |
</div>';
|
299 |
}
|
995 |
function pagelayer_import_handle_replaces($content){
|
996 |
global $pagelayer;
|
997 |
|
998 |
+
// Replace the old ID structure
|
999 |
+
$content = preg_replace_callback('/pagelayer-id="(\w{16})"/s', 'pagelayer_handle_id_sc', $content);
|
1000 |
+
$content = preg_replace_callback('/"pagelayer-id"\:"(\w{16})"/s', 'pagelayer_handle_id', $content);
|
1001 |
+
|
1002 |
foreach($pagelayer->imported_menus_preg as $k => $v){
|
1003 |
$content = preg_replace('/\[pl_wp_menu ([^\]]*)nav_list="'.$k.'"([^\]]*)\]/is', '[pl_wp_menu ${1}nav_list="'.$v.'"${3}]', $content);
|
1004 |
}
|
1098 |
$r['menu-item-status'] = $v['post']['post_status'];
|
1099 |
$r['menu-item-type'] = $v['post']['type'];
|
1100 |
$r['menu-item-object'] = $v['post']['object'];
|
1101 |
+
$r['menu-item-classes'] = implode(' ', $v['post']['classes']);
|
1102 |
|
1103 |
// Any parent ?
|
1104 |
if(!empty($v['post']['menu_item_parent'])){
|
1157 |
|
1158 |
}
|
1159 |
|
1160 |
+
// Change the old style ID to the new style
|
1161 |
+
function pagelayer_handle_id($matches){
|
1162 |
+
//r_print($matches);die();
|
1163 |
+
$str = '"pagelayer-id":"'.pagelayer_create_id().'"';
|
1164 |
+
return $str;
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
// Change the old style ID to the new style
|
1168 |
+
function pagelayer_handle_id_sc($matches){
|
1169 |
+
//r_print($matches);die();
|
1170 |
+
$str = 'pagelayer-id="'.pagelayer_create_id().'"';
|
1171 |
+
return $str;
|
1172 |
+
}
|
1173 |
+
|
1174 |
// Replace Social URLs with the one given in setup
|
1175 |
function pagelayer_handle_social_urls($matches){
|
1176 |
//r_print($matches);die();
|
main/shortcode_functions.php
CHANGED
@@ -118,7 +118,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
118 |
// Create the element array. NOTE : This is similar to the JS el and is temporary
|
119 |
$el['atts'] = $atts;
|
120 |
$el['oAtts'] = $atts;
|
121 |
-
$el['id'] = !empty($atts['pagelayer-id']) ? $atts['pagelayer-id'] :
|
122 |
$el['tmp'] = [];
|
123 |
$el['tag'] = $final_tag;
|
124 |
$el['content'] = $content;
|
@@ -421,7 +421,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
421 |
}
|
422 |
|
423 |
$div = '<div pagelayer-id="'.$el['id'].'">
|
424 |
-
<!-- '.pagelayer_serialize_attributes(['attr' => $el['oAtts'], 'tmp' => $el['tmp']]).' -->
|
425 |
<style pagelayer-style-id="'.$el['id'].'"></style>';
|
426 |
|
427 |
$is_group = !empty($pagelayer->shortcodes[$tag]['params']['elements']) ? true : false;
|
@@ -439,7 +439,10 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
439 |
|
440 |
// Is the element there ?
|
441 |
if(empty($el['atts'][$reqvar])){
|
442 |
-
$
|
|
|
|
|
|
|
443 |
$v->remove();
|
444 |
}
|
445 |
}
|
@@ -661,7 +664,7 @@ function pagelayer_change_id($content){
|
|
661 |
$matches = array_unique($matches[1]);
|
662 |
|
663 |
foreach($matches as $val){
|
664 |
-
$id =
|
665 |
$content = str_replace($val, $id, $content);
|
666 |
}
|
667 |
}
|
118 |
// Create the element array. NOTE : This is similar to the JS el and is temporary
|
119 |
$el['atts'] = $atts;
|
120 |
$el['oAtts'] = $atts;
|
121 |
+
$el['id'] = !empty($atts['pagelayer-id']) ? $atts['pagelayer-id'] : pagelayer_create_id();
|
122 |
$el['tmp'] = [];
|
123 |
$el['tag'] = $final_tag;
|
124 |
$el['content'] = $content;
|
421 |
}
|
422 |
|
423 |
$div = '<div pagelayer-id="'.$el['id'].'">
|
424 |
+
'.(pagelayer_is_live() ? '<!-- '.pagelayer_serialize_attributes(['attr' => $el['oAtts'], 'tmp' => $el['tmp']]).' -->' : '').'
|
425 |
<style pagelayer-style-id="'.$el['id'].'"></style>';
|
426 |
|
427 |
$is_group = !empty($pagelayer->shortcodes[$tag]['params']['elements']) ? true : false;
|
439 |
|
440 |
// Is the element there ?
|
441 |
if(empty($el['atts'][$reqvar])){
|
442 |
+
$ext_html = $v->html();
|
443 |
+
if(strlen($ext_html) > 0){
|
444 |
+
$v->after($ext_html);
|
445 |
+
}
|
446 |
$v->remove();
|
447 |
}
|
448 |
}
|
664 |
$matches = array_unique($matches[1]);
|
665 |
|
666 |
foreach($matches as $val){
|
667 |
+
$id = pagelayer_create_id();
|
668 |
$content = str_replace($val, $id, $content);
|
669 |
}
|
670 |
}
|
main/website.php
CHANGED
@@ -97,6 +97,9 @@ function pagelayer_website_settings(){
|
|
97 |
}
|
98 |
|
99 |
}
|
|
|
|
|
|
|
100 |
|
101 |
// Blank the old Body font
|
102 |
if(!empty($_POST['body']['font-family'])){
|
97 |
}
|
98 |
|
99 |
}
|
100 |
+
|
101 |
+
// Blank the old color values
|
102 |
+
delete_option('pagelayer_color');
|
103 |
|
104 |
// Blank the old Body font
|
105 |
if(!empty($_POST['body']['font-family'])){
|
pagelayer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
-
Version: 1.4.
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
+
Version: 1.4.3
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: page builder, editor, landing page, drag-and-drop, pagelayer, form-builder
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 1.4.
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
@@ -109,6 +109,12 @@ Do you have questions related to PageLayer ? Use the following links :
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.4.2 (Jan 04, 2021) =
|
113 |
* [Bug-Fix] In some cases if the element's inner content contains HTML comments, the element was not rendering properly. This is fixed.
|
114 |
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 1.4.3
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 1.4.3 (Jan 09, 2021) =
|
113 |
+
* [Added] Added alignment option to the sub-menu in the primary menu widget.
|
114 |
+
* [Bug-Fix] The element pagelayer-id has been further improved to fix ModSecurity issues.
|
115 |
+
* [Bug-Fix] In the primary menu widget the sub-menu alignment was not working properly. This is fixed.
|
116 |
+
* [Bug-Fix] In some cases the undo-redo actions was not working properly. This is fixed.
|
117 |
+
|
118 |
= 1.4.2 (Jan 04, 2021) =
|
119 |
* [Bug-Fix] In some cases if the element's inner content contains HTML comments, the element was not rendering properly. This is fixed.
|
120 |
|