Version Description
(Feb 13, 2021) = * [Feature] Added image replacement option inside the media library. * [Bug-Fix] In some cases the video was not playing inside the safari browser. This is fixed. * [Bug-Fix] While editing testimonial slider the group sorting from the left panel was not working properly. This is fixed. * [Bug-Fix] The background slider was not working for free version. This is fixed. * [Bug-Fix] In certain cases while duplicating the widgets the pagelayer classes was not replaced properly. This is fixed. * [Bug-Fix] The header and footer code was not getting blank from website UI settings page. This is fixed. * [Bug-Fix] In some cases, the chart widget was not rendering properly due to JS error. This is fixed.
Download this release
Release Info
Developer | pagelayer |
Plugin | Page Builder: PageLayer – Drag and Drop website builder |
Version | 1.4.6 |
Comparing to | |
See all releases |
Code changes from version 1.4.5 to 1.4.6
- init.php +36 -2
- js/combined.js +5 -1
- js/pagelayer-editor.js +7 -4
- js/pagelayer-frontend.js +5 -1
- js/properties.js +6 -0
- main/live.php +2 -1
- main/replace-media.php +213 -0
- main/settings.php +29 -1
- main/shortcode_functions.php +23 -11
- main/website.php +4 -0
- pagelayer.php +1 -1
- readme.txt +13 -4
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));
|
@@ -296,6 +296,9 @@ function pagelayer_admin_menu() {
|
|
296 |
// License Page
|
297 |
add_submenu_page('pagelayer', __('Pagelayer Editor'), __('License'), $capability, 'pagelayer_license', 'pagelayer_license_page');
|
298 |
|
|
|
|
|
|
|
299 |
}
|
300 |
|
301 |
// This function will handle the Settings Pages in PageLayer
|
@@ -1046,5 +1049,36 @@ function pagelayer_after_logout($user_id){
|
|
1046 |
|
1047 |
}
|
1048 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
// Pagelayer Template Loading Mechanism
|
1050 |
-
include_once(PAGELAYER_DIR.'/main/template.php');
|
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.6');
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
296 |
// License Page
|
297 |
add_submenu_page('pagelayer', __('Pagelayer Editor'), __('License'), $capability, 'pagelayer_license', 'pagelayer_license_page');
|
298 |
|
299 |
+
// Replace Media
|
300 |
+
add_submenu_page('admin.php', __('Replace media', 'pagelayer'), __('Replace media', 'pagelayer'), 'upload_files', 'pagelayer_replace_media', 'pagelayer_replace_media');
|
301 |
+
|
302 |
}
|
303 |
|
304 |
// This function will handle the Settings Pages in PageLayer
|
1049 |
|
1050 |
}
|
1051 |
|
1052 |
+
// Replace Media
|
1053 |
+
$media_replace = get_option( 'pagelayer_disable_media_replace');
|
1054 |
+
if(empty($media_replace)){
|
1055 |
+
|
1056 |
+
// Add URL to Replace Meda
|
1057 |
+
add_filter('media_row_actions', 'pagelayer_add_media_action', 10, 2);
|
1058 |
+
function pagelayer_add_media_action($actions, $post){
|
1059 |
+
|
1060 |
+
$url = admin_url('upload.php');
|
1061 |
+
$url = add_query_arg(array(
|
1062 |
+
'page' => 'pagelayer_replace_media',
|
1063 |
+
'id' => $post->ID,
|
1064 |
+
), $url);
|
1065 |
+
|
1066 |
+
$actions['pagelayer_replace_media'] = '<a href="'.$url.'" rel="permalink">'.esc_html__('Replace media', 'pagelayer').'</a>';
|
1067 |
+
|
1068 |
+
return $actions;
|
1069 |
+
|
1070 |
+
}
|
1071 |
+
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
// Replace Media Function
|
1075 |
+
function pagelayer_replace_media(){
|
1076 |
+
|
1077 |
+
include_once(PAGELAYER_DIR.'/main/replace-media.php');
|
1078 |
+
|
1079 |
+
pagelayer_replace_page();
|
1080 |
+
|
1081 |
+
}
|
1082 |
+
|
1083 |
// Pagelayer Template Loading Mechanism
|
1084 |
+
include_once(PAGELAYER_DIR.'/main/template.php');
|
js/combined.js
CHANGED
@@ -85,6 +85,10 @@ jQuery(document).ready(function(){
|
|
85 |
jQuery('ul.pagelayer-mega-menu').each(function(){
|
86 |
pagelayer_mega_menu_position(jQuery(this));
|
87 |
});
|
|
|
|
|
|
|
|
|
88 |
|
89 |
pagelayer_stars();
|
90 |
|
@@ -521,7 +525,7 @@ function pagelayer_pl_video(jEle){
|
|
521 |
}
|
522 |
|
523 |
var vidElm = jQuery(this).contents().find('video');
|
524 |
-
var vidSrc = vidElm.children()[0].src;
|
525 |
|
526 |
if(vidSrc[vidSrc.indexOf('&loop=')+6] == 1){
|
527 |
vidElm.attr('loop','loop');
|
85 |
jQuery('ul.pagelayer-mega-menu').each(function(){
|
86 |
pagelayer_mega_menu_position(jQuery(this));
|
87 |
});
|
88 |
+
|
89 |
+
jQuery('.pagelayer-bgimg-slider').each(function(){
|
90 |
+
pagelayer_pl_row_slider(jQuery(this));
|
91 |
+
});
|
92 |
|
93 |
pagelayer_stars();
|
94 |
|
525 |
}
|
526 |
|
527 |
var vidElm = jQuery(this).contents().find('video');
|
528 |
+
var vidSrc = (pagelayer_empty(vidElm[0].src)) ? vidElm.children()[0].src : vidElm[0].src;
|
529 |
|
530 |
if(vidSrc[vidSrc.indexOf('&loop=')+6] == 1){
|
531 |
vidElm.attr('loop','loop');
|
js/pagelayer-editor.js
CHANGED
@@ -1277,7 +1277,7 @@ function pagelayer_id(jEle){
|
|
1277 |
}
|
1278 |
|
1279 |
// Remove Pagelayer ID class
|
1280 |
-
function
|
1281 |
var id = jEle.attr('pagelayer-id');
|
1282 |
jEle.removeClass('p-'+id);
|
1283 |
}
|
@@ -1374,7 +1374,7 @@ function pagelayer_element_setup(selector, render){
|
|
1374 |
pagelayer.el[id] = pagelayer_el_get_data(jEle);
|
1375 |
//console.log(jEle[0].outerHTML);
|
1376 |
//console.log(pagelayer.el[id]);
|
1377 |
-
|
1378 |
if(render){
|
1379 |
pagelayer_sc_render(jEle);
|
1380 |
}
|
@@ -1534,9 +1534,12 @@ function pagelayer_element_unsetup(selector, id){
|
|
1534 |
var html = src[0].outerHTML;
|
1535 |
|
1536 |
var jEle = jQuery(html);
|
1537 |
-
|
1538 |
jEle.removeAttr('pagelayer-id');
|
1539 |
-
jEle.find('[pagelayer-id]').
|
|
|
|
|
|
|
1540 |
jEle.find('[pagelayer-parent]').removeAttr('pagelayer-parent');// Remove the parent attribute as it will be reset during pagelayer_element_setup
|
1541 |
jEle.find('style').remove();
|
1542 |
jEle.find('.pagelayer-ele-overlay').remove();
|
1277 |
}
|
1278 |
|
1279 |
// Remove Pagelayer ID class
|
1280 |
+
function pagelayer_remove_id_class(jEle){
|
1281 |
var id = jEle.attr('pagelayer-id');
|
1282 |
jEle.removeClass('p-'+id);
|
1283 |
}
|
1374 |
pagelayer.el[id] = pagelayer_el_get_data(jEle);
|
1375 |
//console.log(jEle[0].outerHTML);
|
1376 |
//console.log(pagelayer.el[id]);
|
1377 |
+
|
1378 |
if(render){
|
1379 |
pagelayer_sc_render(jEle);
|
1380 |
}
|
1534 |
var html = src[0].outerHTML;
|
1535 |
|
1536 |
var jEle = jQuery(html);
|
1537 |
+
pagelayer_remove_id_class(jEle);
|
1538 |
jEle.removeAttr('pagelayer-id');
|
1539 |
+
jEle.find('[pagelayer-id]').each(function(){
|
1540 |
+
pagelayer_remove_id_class(jQuery(this));
|
1541 |
+
jQuery(this).removeAttr('pagelayer-id');
|
1542 |
+
});
|
1543 |
jEle.find('[pagelayer-parent]').removeAttr('pagelayer-parent');// Remove the parent attribute as it will be reset during pagelayer_element_setup
|
1544 |
jEle.find('style').remove();
|
1545 |
jEle.find('.pagelayer-ele-overlay').remove();
|
js/pagelayer-frontend.js
CHANGED
@@ -85,6 +85,10 @@ jQuery(document).ready(function(){
|
|
85 |
jQuery('ul.pagelayer-mega-menu').each(function(){
|
86 |
pagelayer_mega_menu_position(jQuery(this));
|
87 |
});
|
|
|
|
|
|
|
|
|
88 |
|
89 |
pagelayer_stars();
|
90 |
|
@@ -521,7 +525,7 @@ function pagelayer_pl_video(jEle){
|
|
521 |
}
|
522 |
|
523 |
var vidElm = jQuery(this).contents().find('video');
|
524 |
-
var vidSrc = vidElm.children()[0].src;
|
525 |
|
526 |
if(vidSrc[vidSrc.indexOf('&loop=')+6] == 1){
|
527 |
vidElm.attr('loop','loop');
|
85 |
jQuery('ul.pagelayer-mega-menu').each(function(){
|
86 |
pagelayer_mega_menu_position(jQuery(this));
|
87 |
});
|
88 |
+
|
89 |
+
jQuery('.pagelayer-bgimg-slider').each(function(){
|
90 |
+
pagelayer_pl_row_slider(jQuery(this));
|
91 |
+
});
|
92 |
|
93 |
pagelayer_stars();
|
94 |
|
525 |
}
|
526 |
|
527 |
var vidElm = jQuery(this).contents().find('video');
|
528 |
+
var vidSrc = (pagelayer_empty(vidElm[0].src)) ? vidElm.children()[0].src : vidElm[0].src;
|
529 |
|
530 |
if(vidSrc[vidSrc.indexOf('&loop=')+6] == 1){
|
531 |
vidElm.attr('loop','loop');
|
js/properties.js
CHANGED
@@ -2693,6 +2693,12 @@ function pagelayer_moving_element(jEle, start_pos, end_pos){
|
|
2693 |
var par = wrap.parent();
|
2694 |
var children = par.children("div");
|
2695 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2696 |
var element = children.eq(start_pos).detach();
|
2697 |
if(end_pos < start_pos){
|
2698 |
children.eq(end_pos).before(element);
|
2693 |
var par = wrap.parent();
|
2694 |
var children = par.children("div");
|
2695 |
|
2696 |
+
// This is required for Owl Carousel
|
2697 |
+
if(children.length==1){
|
2698 |
+
par = par.parent();
|
2699 |
+
children = par.children("div");
|
2700 |
+
}
|
2701 |
+
|
2702 |
var element = children.eq(start_pos).detach();
|
2703 |
if(end_pos < start_pos){
|
2704 |
children.eq(end_pos).before(element);
|
main/live.php
CHANGED
@@ -100,6 +100,7 @@ class PageLayer_LiveEditor{
|
|
100 |
|
101 |
// Export the post props
|
102 |
$_post = clone $post;
|
|
|
103 |
unset($_post->post_content);
|
104 |
|
105 |
// Add template type
|
@@ -107,7 +108,7 @@ class PageLayer_LiveEditor{
|
|
107 |
$_post->pagelayer_template_type = get_post_meta($_post->ID, 'pagelayer_template_type', true);
|
108 |
}
|
109 |
|
110 |
-
$returnURL = (
|
111 |
|
112 |
// Get CAPTCHA site key
|
113 |
$pagelayer_recaptch_site_key = get_option('pagelayer_google_captcha');
|
100 |
|
101 |
// Export the post props
|
102 |
$_post = clone $post;
|
103 |
+
|
104 |
unset($_post->post_content);
|
105 |
|
106 |
// Add template type
|
108 |
$_post->pagelayer_template_type = get_post_meta($_post->ID, 'pagelayer_template_type', true);
|
109 |
}
|
110 |
|
111 |
+
$returnURL = ($_post->post_type == 'post' ? admin_url('edit.php') : admin_url('edit.php?post_type='.$_post->post_type) );
|
112 |
|
113 |
// Get CAPTCHA site key
|
114 |
$pagelayer_recaptch_site_key = get_option('pagelayer_google_captcha');
|
main/replace-media.php
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
//////////////////////////////////////////////////////////////
|
4 |
+
//===========================================================
|
5 |
+
// template.php
|
6 |
+
//===========================================================
|
7 |
+
// PAGELAYER
|
8 |
+
// Inspired by the DESIRE to be the BEST OF ALL
|
9 |
+
// ----------------------------------------------------------
|
10 |
+
// Started by: Pulkit Gupta
|
11 |
+
// Date: 23rd Jan 2017
|
12 |
+
// Time: 23:00 hrs
|
13 |
+
// Site: http://pagelayer.com/wordpress (PAGELAYER)
|
14 |
+
// ----------------------------------------------------------
|
15 |
+
// Please Read the Terms of use at http://pagelayer.com/tos
|
16 |
+
// ----------------------------------------------------------
|
17 |
+
//===========================================================
|
18 |
+
// (c)Pagelayer Team
|
19 |
+
//===========================================================
|
20 |
+
//////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
// Are we being accessed directly ?
|
23 |
+
if(!defined('PAGELAYER_VERSION')) {
|
24 |
+
exit('Hacking Attempt !');
|
25 |
+
}
|
26 |
+
|
27 |
+
//function is called first to select the route
|
28 |
+
function pagelayer_replace_page(){
|
29 |
+
|
30 |
+
global $pl_error;
|
31 |
+
|
32 |
+
if(!current_user_can('upload_files')){
|
33 |
+
wp_die(esc_html__('You do not have permission to upload files.', 'pagelayer'));
|
34 |
+
}
|
35 |
+
|
36 |
+
$post_id = (int) $_GET['id'];
|
37 |
+
|
38 |
+
if(empty($post_id)){
|
39 |
+
wp_die(esc_html__('ID not found .', 'pagelayer'));
|
40 |
+
}
|
41 |
+
|
42 |
+
// Load the attachment
|
43 |
+
$post = get_post($post_id);
|
44 |
+
|
45 |
+
if(empty($post) || is_wp_error($post)){
|
46 |
+
wp_die(esc_html__('ID not found .', 'pagelayer'));
|
47 |
+
}
|
48 |
+
|
49 |
+
// Process the POST !
|
50 |
+
if(isset($_FILES['userfile'])){
|
51 |
+
|
52 |
+
if(!check_admin_referer()){
|
53 |
+
wp_die('Invalid Nonce');
|
54 |
+
}
|
55 |
+
|
56 |
+
/** Check if file is uploaded properly **/
|
57 |
+
if(!is_uploaded_file($_FILES['userfile']['tmp_name'])){
|
58 |
+
$pl_error['upload_error'] = __('No file was uploaded ! Please try again.');
|
59 |
+
pagelayer_media_replace_theme();
|
60 |
+
return;
|
61 |
+
}
|
62 |
+
|
63 |
+
if(isset($_FILES['userfile']['error']) && $_FILES['userfile']['error'] > 0){
|
64 |
+
$pl_error['upload_error'] = __('There was some error uploading the file ! Please try again.');
|
65 |
+
pagelayer_media_replace_theme();
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
$filedata = wp_check_filetype_and_ext($_FILES['userfile']['tmp_name'], $_FILES['userfile']['name']);
|
70 |
+
|
71 |
+
if ($filedata['ext'] == false){
|
72 |
+
$pl_error['ext_error'] = __('The File type could not be determined. Please upload a permitted file type.');
|
73 |
+
pagelayer_media_replace_theme();
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
$result = pagelayer_replace_attachment($_FILES['userfile']['tmp_name'], $post_id, $err);
|
78 |
+
|
79 |
+
if(empty($result)){
|
80 |
+
$pl_error['replace_error'] = $err;
|
81 |
+
pagelayer_media_replace_theme();
|
82 |
+
return;
|
83 |
+
}
|
84 |
+
|
85 |
+
$redirect_success = admin_url('post.php');
|
86 |
+
$redirect_success = add_query_arg(array(
|
87 |
+
'action' => 'edit',
|
88 |
+
'post' => $post_id,
|
89 |
+
), $redirect_success);
|
90 |
+
|
91 |
+
echo '<meta http-equiv="refresh" content="0;url='.$redirect_success.'" />';
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
// Show the theme
|
96 |
+
pagelayer_media_replace_theme();
|
97 |
+
|
98 |
+
}
|
99 |
+
|
100 |
+
// Theme of the page
|
101 |
+
function pagelayer_media_replace_theme(){
|
102 |
+
|
103 |
+
global $pl_error;
|
104 |
+
|
105 |
+
pagelayer_report_error($pl_error);echo '<br />';
|
106 |
+
|
107 |
+
$id = (int) $_GET['id'];
|
108 |
+
|
109 |
+
?>
|
110 |
+
<div class="wrap">
|
111 |
+
<h1><?php echo esc_html__("Replace Media File", 'pagelayer'); ?></h1>
|
112 |
+
<form enctype="multipart/form-data" method="POST">
|
113 |
+
<div class="editor-wrapper">
|
114 |
+
<section class="image_chooser wrapper">
|
115 |
+
<input type="hidden" name="ID" id="ID" value="<?php echo $id ?>" />
|
116 |
+
<p><?php echo esc_html__("Choose a file to upload from your computer", 'pagelayer'); ?></p>
|
117 |
+
<div class="drop-wrapper">
|
118 |
+
<p><input type="file" name="userfile" id="userfile" /></p>
|
119 |
+
<?php wp_nonce_field(); ?>
|
120 |
+
</div>
|
121 |
+
</section>
|
122 |
+
<section class="form_controls wrapper">
|
123 |
+
<input id="submit" type="submit" class="button button-primary" name="submit" value="<?php echo esc_attr__("Upload", 'pagelayer');?>" />
|
124 |
+
</section>
|
125 |
+
</div>
|
126 |
+
</form>
|
127 |
+
<?php
|
128 |
+
|
129 |
+
}
|
130 |
+
|
131 |
+
// Replace the uploaded media with the new one
|
132 |
+
function pagelayer_replace_attachment($file, $post_id, &$error = ''){
|
133 |
+
|
134 |
+
if(function_exists('wp_get_original_image_path')){
|
135 |
+
$targetFile = wp_get_original_image_path($post_id);
|
136 |
+
}else{
|
137 |
+
$targetFile = trim(get_attached_file($post_id, apply_filters( 'pagelayer_unfiltered_get_attached_file', true )));
|
138 |
+
}
|
139 |
+
|
140 |
+
$fileparts = pathinfo($targetFile);
|
141 |
+
$filePath = isset($fileparts['dirname']) ? trailingslashit($fileparts['dirname']) : '';
|
142 |
+
$fileName = isset($fileparts['basename']) ? $fileparts['basename'] : '';
|
143 |
+
$filedata = wp_check_filetype_and_ext($targetFile, $fileName);
|
144 |
+
$fileMime = (isset($filedata['type'])) ? $filedata['type'] : false;
|
145 |
+
|
146 |
+
if(empty($targetFile)){
|
147 |
+
return false;
|
148 |
+
}
|
149 |
+
|
150 |
+
if(empty($filePath)){
|
151 |
+
$error = 'No folder for the target found !';
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
|
155 |
+
// Remove the files of the original attachment
|
156 |
+
pagelayer_remove_attahment_files($post_id);
|
157 |
+
|
158 |
+
$result_moved = move_uploaded_file($file, $targetFile);
|
159 |
+
|
160 |
+
if (false === $result_moved){
|
161 |
+
$error = sprintf( esc_html__('The uploaded file could not be moved to %1$s. This is most likely an issue with permissions, or upload failed.', 'pagelayer'), $targetFile );
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
|
165 |
+
$permissions = fileperms($targetFile) & 0777;
|
166 |
+
if ($permissions > 0){
|
167 |
+
chmod( $targetFile, $permissions ); // restore permissions
|
168 |
+
}
|
169 |
+
|
170 |
+
$updated = update_attached_file($post_id, $targetFile);
|
171 |
+
|
172 |
+
$target_url = wp_get_attachment_url($post_id);
|
173 |
+
|
174 |
+
// Run the filter, so other plugins can hook if needed.
|
175 |
+
$filtered = apply_filters( 'wp_handle_upload', array(
|
176 |
+
'file' => $targetFile,
|
177 |
+
'url' => $target_url,
|
178 |
+
'type' => $fileMime,
|
179 |
+
), 'sideload');
|
180 |
+
|
181 |
+
// Check if file changed during filter. Set changed to attached file meta properly.
|
182 |
+
if (isset($filtered['file']) && $filtered['file'] != $targetFile ){
|
183 |
+
update_attached_file($post_id, $filtered['file']);
|
184 |
+
}
|
185 |
+
|
186 |
+
$metadata = wp_generate_attachment_metadata($post_id, $targetFile);
|
187 |
+
wp_update_attachment_metadata($post_id, $metadata);
|
188 |
+
|
189 |
+
return true;
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
+
function pagelayer_remove_attahment_files($post_id){
|
194 |
+
|
195 |
+
$meta = wp_get_attachment_metadata( $post_id );
|
196 |
+
|
197 |
+
if (function_exists('wp_get_original_image_path')){ // WP 5.3+
|
198 |
+
$fullfilepath = wp_get_original_image_path($post_id);
|
199 |
+
}else{
|
200 |
+
$fullFilePath = trim(get_attached_file($post_id, apply_filters( 'pagelayer_unfiltered_get_attached_file', true )));
|
201 |
+
}
|
202 |
+
|
203 |
+
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
204 |
+
$file = $fullFilePath;
|
205 |
+
$result = wp_delete_attachment_files($post_id, $meta, $backup_sizes, $file );
|
206 |
+
|
207 |
+
// If attached file is not the same path as file, this indicates a -scaled images is in play.
|
208 |
+
$attached_file = get_attached_file($post_id);
|
209 |
+
|
210 |
+
if ($file !== $attached_file && file_exists($attached_file)){
|
211 |
+
@unlink($attached_file);
|
212 |
+
}
|
213 |
+
}
|
main/settings.php
CHANGED
@@ -419,6 +419,20 @@ function pagelayer_settings_page(){
|
|
419 |
|
420 |
pagelayer_page_header('Pagelayer Settings');
|
421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
// Saved ?
|
423 |
if(!empty($done)){
|
424 |
echo '<div class="notice notice-success"><p>'. __('The settings were saved successfully', 'pagelayer'). '</p></div><br />';
|
@@ -469,6 +483,14 @@ function pagelayer_settings_page(){
|
|
469 |
</label>
|
470 |
</td>
|
471 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
</table>
|
473 |
</div>
|
474 |
<div class="pagelayer-tab-panel" id="icons">
|
@@ -477,7 +499,13 @@ function pagelayer_settings_page(){
|
|
477 |
<th scope="row"><?php _e('Enable Icons');?></th>
|
478 |
<td>
|
479 |
<label>
|
480 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
481 |
</label>
|
482 |
</td>
|
483 |
</tr>
|
419 |
|
420 |
pagelayer_page_header('Pagelayer Settings');
|
421 |
|
422 |
+
// Media Replace.
|
423 |
+
if(isset($_POST['submit']) || isset($_POST['pagelayer_disable_media_replace'])){
|
424 |
+
|
425 |
+
$disable_media = empty($_REQUEST['pagelayer_disable_media_replace']) ? 0 : 1;
|
426 |
+
|
427 |
+
update_option( 'pagelayer_disable_media_replace', $disable_media );
|
428 |
+
|
429 |
+
$done = 1;
|
430 |
+
|
431 |
+
}
|
432 |
+
|
433 |
+
// Media Replace
|
434 |
+
$media_replace = get_option( 'pagelayer_disable_media_replace');
|
435 |
+
|
436 |
// Saved ?
|
437 |
if(!empty($done)){
|
438 |
echo '<div class="notice notice-success"><p>'. __('The settings were saved successfully', 'pagelayer'). '</p></div><br />';
|
483 |
</label>
|
484 |
</td>
|
485 |
</tr>
|
486 |
+
<tr>
|
487 |
+
<th scope="row"><?php _e('Media Replace');?></th>
|
488 |
+
<td>
|
489 |
+
<label>
|
490 |
+
<input type="checkbox" name="pagelayer_disable_media_replace" <?php echo (!empty( $media_replace) ? ' checked' : '');?> /><?php _e('Disable Media Replace') ?></br>
|
491 |
+
</label>
|
492 |
+
</td>
|
493 |
+
</tr>
|
494 |
</table>
|
495 |
</div>
|
496 |
<div class="pagelayer-tab-panel" id="icons">
|
499 |
<th scope="row"><?php _e('Enable Icons');?></th>
|
500 |
<td>
|
501 |
<label>
|
502 |
+
<?php
|
503 |
+
$pagelayer_icons = get_option( 'pagelayer_icons_set');
|
504 |
+
if(empty($pagelayer_icons)){
|
505 |
+
$pagelayer_icons = array();
|
506 |
+
}
|
507 |
+
?>
|
508 |
+
<input type="checkbox" name="pagelayer_icons_set[]" value="font-awesome5" <?php if(in_array('font-awesome5', $pagelayer_icons) || !get_option( 'pagelayer_icons_set')){echo ' checked';}?> /><?php _e('font-awesome5'); ?></br>
|
509 |
</label>
|
510 |
</td>
|
511 |
</tr>
|
main/shortcode_functions.php
CHANGED
@@ -115,6 +115,11 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
115 |
$func = 'pagelayer_sc_'.substr($tag, 3);
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
118 |
// Create the element array. NOTE : This is similar to the JS el and is temporary
|
119 |
$el['atts'] = $atts;
|
120 |
$el['oAtts'] = $atts;
|
@@ -416,7 +421,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
416 |
$div = '<div pagelayer-id="'.$el['id'].'">
|
417 |
<style pagelayer-style-id="'.$el['id'].'"></style>';
|
418 |
|
419 |
-
$is_group = !empty($pagelayer->shortcodes[$tag]['
|
420 |
|
421 |
// If there is an HTML AND you are not a GROUP, then make use of it, or append the real content
|
422 |
if(!empty($pagelayer->shortcodes[$tag]['html'])){
|
@@ -616,14 +621,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
616 |
// Is there an inner content which requires a SHORTCODE ?
|
617 |
if(!empty($do_shortcode)){
|
618 |
|
619 |
-
$inner_content =
|
620 |
-
if( !empty($el['inner_blocks']) ){
|
621 |
-
foreach($el['inner_blocks'] as $inner_block){
|
622 |
-
$inner_content .= render_block($inner_block);
|
623 |
-
}
|
624 |
-
}else{
|
625 |
-
$inner_content .= do_shortcode($el['content']);
|
626 |
-
}
|
627 |
|
628 |
$div = str_replace('{{pagelayer_do_shortcode}}', $inner_content, $div);
|
629 |
}
|
@@ -635,6 +633,22 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
635 |
|
636 |
}
|
637 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
// Change pagelayer id in html
|
639 |
function pagelayer_change_id($content){
|
640 |
global $pagelayer;
|
@@ -1229,7 +1243,6 @@ function pagelayer_sc_wp_widgets(&$el){
|
|
1229 |
$el['tmp']['data'] = $data;
|
1230 |
}
|
1231 |
|
1232 |
-
|
1233 |
// Service Handler
|
1234 |
function pagelayer_sc_service(&$el){
|
1235 |
|
@@ -1239,7 +1252,6 @@ function pagelayer_sc_service(&$el){
|
|
1239 |
}
|
1240 |
}
|
1241 |
|
1242 |
-
|
1243 |
/*pagelayer_print($atts);
|
1244 |
pagelayer_print($content);
|
1245 |
die();*/
|
115 |
$func = 'pagelayer_sc_'.substr($tag, 3);
|
116 |
}
|
117 |
|
118 |
+
// UnescapeHTML for the attributes, Fix for old shortcode method
|
119 |
+
if(empty($is_block)){
|
120 |
+
$atts = array_map('pagelayer_unescapeHTML', $atts);
|
121 |
+
}
|
122 |
+
|
123 |
// Create the element array. NOTE : This is similar to the JS el and is temporary
|
124 |
$el['atts'] = $atts;
|
125 |
$el['oAtts'] = $atts;
|
421 |
$div = '<div pagelayer-id="'.$el['id'].'">
|
422 |
<style pagelayer-style-id="'.$el['id'].'"></style>';
|
423 |
|
424 |
+
$is_group = !empty($pagelayer->shortcodes[$tag]['has_group']) ? true : false;
|
425 |
|
426 |
// If there is an HTML AND you are not a GROUP, then make use of it, or append the real content
|
427 |
if(!empty($pagelayer->shortcodes[$tag]['html'])){
|
621 |
// Is there an inner content which requires a SHORTCODE ?
|
622 |
if(!empty($do_shortcode)){
|
623 |
|
624 |
+
$inner_content = pagelayer_render_inner_content($el);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
|
626 |
$div = str_replace('{{pagelayer_do_shortcode}}', $inner_content, $div);
|
627 |
}
|
633 |
|
634 |
}
|
635 |
|
636 |
+
// Render inner content
|
637 |
+
function pagelayer_render_inner_content(&$el){
|
638 |
+
|
639 |
+
$inner_content = '';
|
640 |
+
|
641 |
+
if( !empty($el['inner_blocks']) ){
|
642 |
+
foreach($el['inner_blocks'] as $inner_block){
|
643 |
+
$inner_content .= render_block($inner_block);
|
644 |
+
}
|
645 |
+
}else{
|
646 |
+
$inner_content .= do_shortcode($el['content']);
|
647 |
+
}
|
648 |
+
|
649 |
+
return $inner_content;
|
650 |
+
}
|
651 |
+
|
652 |
// Change pagelayer id in html
|
653 |
function pagelayer_change_id($content){
|
654 |
global $pagelayer;
|
1243 |
$el['tmp']['data'] = $data;
|
1244 |
}
|
1245 |
|
|
|
1246 |
// Service Handler
|
1247 |
function pagelayer_sc_service(&$el){
|
1248 |
|
1252 |
}
|
1253 |
}
|
1254 |
|
|
|
1255 |
/*pagelayer_print($atts);
|
1256 |
pagelayer_print($content);
|
1257 |
die();*/
|
main/website.php
CHANGED
@@ -133,11 +133,15 @@ function pagelayer_website_settings(){
|
|
133 |
// Save Header code
|
134 |
if(isset($_REQUEST['pagelayer_header_code'])){
|
135 |
update_option( 'pagelayer_header_code', wp_unslash($_REQUEST['pagelayer_header_code'] ));
|
|
|
|
|
136 |
}
|
137 |
|
138 |
// Save Footyer code
|
139 |
if(isset($_REQUEST['pagelayer_footer_code'])){
|
140 |
update_option( 'pagelayer_footer_code', wp_unslash($_REQUEST['pagelayer_footer_code'] ));
|
|
|
|
|
141 |
}
|
142 |
|
143 |
}
|
133 |
// Save Header code
|
134 |
if(isset($_REQUEST['pagelayer_header_code'])){
|
135 |
update_option( 'pagelayer_header_code', wp_unslash($_REQUEST['pagelayer_header_code'] ));
|
136 |
+
}else{
|
137 |
+
delete_option('pagelayer_header_code');
|
138 |
}
|
139 |
|
140 |
// Save Footyer code
|
141 |
if(isset($_REQUEST['pagelayer_footer_code'])){
|
142 |
update_option( 'pagelayer_footer_code', wp_unslash($_REQUEST['pagelayer_footer_code'] ));
|
143 |
+
}else{
|
144 |
+
delete_option('pagelayer_footer_code');
|
145 |
}
|
146 |
|
147 |
}
|
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.6
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Page Builder: PageLayer - Drag and Drop website builder ===
|
2 |
Contributors: pagelayer
|
3 |
-
Tags: page builder, editor,
|
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,9 +109,18 @@ Do you have questions related to PageLayer ? Use the following links :
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.4.5 (Jan 27, 2021) =
|
113 |
-
* [Bug-Fix] In some cases
|
114 |
-
* [Bug-Fix] In some cases
|
115 |
|
116 |
= 1.4.4 (Jan 22, 2021) =
|
117 |
* [Feature] Added the option to revert a setting to the default.
|
1 |
=== Page Builder: PageLayer - Drag and Drop website builder ===
|
2 |
Contributors: pagelayer
|
3 |
+
Tags: page builder, editor, drag-and-drop, landing page, replace image, pagelayer, form-builder, popup, widgets, softaculous, visual editor, wysiwyg, design, maintenance mode, coming soon, under construction, website builder, landing page builder, front-end builder, site-builder
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 1.4.6
|
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.6 (Feb 13, 2021) =
|
113 |
+
* [Feature] Added image replacement option inside the media library.
|
114 |
+
* [Bug-Fix] In some cases the video was not playing inside the safari browser. This is fixed.
|
115 |
+
* [Bug-Fix] While editing testimonial slider the group sorting from the left panel was not working properly. This is fixed.
|
116 |
+
* [Bug-Fix] The background slider was not working for free version. This is fixed.
|
117 |
+
* [Bug-Fix] In certain cases while duplicating the widgets the pagelayer classes was not replaced properly. This is fixed.
|
118 |
+
* [Bug-Fix] The header and footer code was not getting blank from website UI settings page. This is fixed.
|
119 |
+
* [Bug-Fix] In some cases, the chart widget was not rendering properly due to JS error. This is fixed.
|
120 |
+
|
121 |
= 1.4.5 (Jan 27, 2021) =
|
122 |
+
* [Bug-Fix] In some cases the apply revision was not working properly after the last version. This is fixed.
|
123 |
+
* [Bug-Fix] In some cases the global widget content was not updated properly. This is fixed.
|
124 |
|
125 |
= 1.4.4 (Jan 22, 2021) =
|
126 |
* [Feature] Added the option to revert a setting to the default.
|