Page Builder: PageLayer – Drag and Drop website builder - Version 1.4.9

Version Description

(April 17, 2021) = * [Feature] Added the feature to upload Custom Fonts. Users can now use fonts other than Google Fonts by uploading their choice of fonts. * [Feature] The Page / Post properties are now visible by default while editing a post / page. We have added many options like Categories, Tags, Permalink, Publish Post at a future date, Excerpt, Discussion options, etc. * [Feature] While editing the contact form, you can now design the success and error messages. * [Task] By default, the page settings will now be shown while editing in Pagelayer. * [Task] On submitting the contact form, the submit button will now show a progress circle. * [Task] Added title and alt attributes for all possible image tags for improving accessibility reading. * [Task] Added more options for Badge Widget. * [Task] Added the dark mode option for the pagelayer editor, you can enable dark mode from the pagelayer setting. * [Task] Added default inner content in the tab widget. * [Bug-Fix] The padding for overlay in the Image Portfolio widget was not working. This is fixed. * [Bug-Fix] The right click menu in Pagelayer Editor would cross the edges of the view port. This is fixed. * [Bug-Fix] In case of the Address, Email or Phone Widgets, if the value exceeded the column width, the column layout would break. This is fixed. * [Bug-Fix] When the image widget was given an animation and also had an overlay, the animation would not work. This is fixed. * [Bug-Fix] Box shadow CSS was not working in some places. This is fixed. * [Bug-Fix] In some cases, the dots of the Slides Widget's slider were hidden. This is fixed. * [Bug-Fix] In some cases, some part of the "Facebook Likes" button was hidden. This is fixed. * [Bug-Fix] When loading a page / post in editor mode, the splash modal was shown each time if the display option "Always" was set. This is fixed. * [Bug-Fix] In some cases, the global table widget was not updated properly when editing the global table using the inline editor. This is fixed. * [Bug-Fix] The title in the menu list widget was not edited properly using the inline editor. This is fixed.

Download this release

Release Info

Developer pagelayer
Plugin Icon 128x128 Page Builder: PageLayer – Drag and Drop website builder
Version 1.4.9
Comparing to
See all releases

Code changes from version 1.4.8 to 1.4.9

css/combined.css CHANGED
@@ -328,6 +328,8 @@ max-width: 100%;
328
 
329
  .pagelayer-service-btn{
330
  display:inline-block;
 
 
331
  }
332
 
333
  .pagelayer-service-details{
@@ -2888,7 +2890,6 @@ margin-right: auto;
2888
 
2889
  .pagelayer-owl-stage-outer [class^="pagelayer-owl-"],
2890
  .pagelayer-owl-carousel .pagelayer-ele-wrap,
2891
- .pagelayer-slides-holder,
2892
  .pagelayer-owl-stage-outer{
2893
  height: 100%;
2894
  }
@@ -2945,6 +2946,7 @@ display:flex;
2945
  .pagelayer-email{
2946
  margin-top:auto;
2947
  margin-bottom:auto;
 
2948
  }
2949
 
2950
  /* Address and Number End */
@@ -3326,6 +3328,10 @@ white-space:normal !important;
3326
  /* Primary Menu End */
3327
 
3328
  /* Contact Form start */
 
 
 
 
3329
  .pagelayer-contact_item input,
3330
  .pagelayer-contact_item textarea,
3331
  .pagelayer-contact_item select{
@@ -4961,6 +4967,7 @@ width:100%;
4961
  /*** Freemium End ***/
4962
  /********************/
4963
 
 
4964
  /*!
4965
  * Nivo Lightbox v1.3.1
4966
  * http://dev7studios.com/nivo-lightbox
328
 
329
  .pagelayer-service-btn{
330
  display:inline-block;
331
+ position:relative;
332
+ z-index:999;
333
  }
334
 
335
  .pagelayer-service-details{
2890
 
2891
  .pagelayer-owl-stage-outer [class^="pagelayer-owl-"],
2892
  .pagelayer-owl-carousel .pagelayer-ele-wrap,
 
2893
  .pagelayer-owl-stage-outer{
2894
  height: 100%;
2895
  }
2946
  .pagelayer-email{
2947
  margin-top:auto;
2948
  margin-bottom:auto;
2949
+ word-break:break-word;
2950
  }
2951
 
2952
  /* Address and Number End */
3328
  /* Primary Menu End */
3329
 
3330
  /* Contact Form start */
3331
+ .pagelayer-contact-form-note{
3332
+ margin-bottom:10px;
3333
+ }
3334
+
3335
  .pagelayer-contact_item input,
3336
  .pagelayer-contact_item textarea,
3337
  .pagelayer-contact_item select{
4967
  /*** Freemium End ***/
4968
  /********************/
4969
 
4970
+
4971
  /*!
4972
  * Nivo Lightbox v1.3.1
4973
  * http://dev7studios.com/nivo-lightbox
css/pagelayer-admin.css CHANGED
@@ -84,7 +84,10 @@ display:none;
84
  }
85
 
86
  .pagelayer-heading-tab{
87
- background: #fff !important;
 
 
 
88
  }
89
 
90
  .pagelayer-heading-wrapper{
84
  }
85
 
86
  .pagelayer-heading-tab{
87
+ background: #fff !important;
88
+ border: 1px solid #ccc;
89
+ border-bottom: 0px;
90
+ border-radius:0px;
91
  }
92
 
93
  .pagelayer-heading-wrapper{
css/pagelayer-editor.css CHANGED
@@ -529,6 +529,12 @@ padding: 10px 6px;
529
  margin: 0px 5px 0px 0px;
530
  }
531
 
 
 
 
 
 
 
532
  .pagelayer-dark .pagelayer-elpd-tab,
533
  .pagelayer-dark .pagelayer-history-tab,
534
  .pagelayer-dark .pagelayer-widget-tab{
@@ -576,6 +582,7 @@ flex-direction:column-reverse;
576
  [pagelayer-elpd-active-tab="1"],
577
  [pagelayer-history-active-tab="1"] {
578
  color: #3e8ef7;
 
579
  }
580
 
581
  .pagelayer-dark [pagelayer-elpd-active-tab="1"],
@@ -676,7 +683,10 @@ font-size: 12px;
676
  line-height: 150%;
677
  }
678
 
679
- .pagelayer-dark .pagelayer-elp-label{
 
 
 
680
  color:#bdbdbd;
681
  }
682
 
@@ -802,7 +812,9 @@ display:none;
802
  width: 20px;
803
  height: 20px;
804
  cursor: pointer;
805
- margin:4px;
 
 
806
  }
807
 
808
  .pagelayer-elp-default:focus{
@@ -816,12 +828,13 @@ color: black;
816
 
817
  /* Default button css ends */
818
 
819
- .pagelayer-elp-desc{
820
- color: rgba(49, 52, 57, 0.8);
821
  font-size: 12px;
822
  line-height: 20px;
823
  font-style: italic;
824
  margin-top: 5px;
 
825
  }
826
 
827
  .pagelayer-elpd-body input,
@@ -846,6 +859,7 @@ resize:vertical;
846
  .pagelayer-dark .pagelayer-elpd-body textarea,
847
  .pagelayer-dark .pagelayer-elpd-body select,
848
  .pagelayer-dark .pagelayer-elpd-body option,
 
849
  .pagelayer-dark .pagelayer-elp-multiselect{
850
  border:1px solid #6e6d6d;
851
  }
@@ -854,6 +868,7 @@ resize:vertical;
854
  .pagelayer-dark .pagelayer-elpd-body textarea,
855
  .pagelayer-dark .pagelayer-elpd-body select,
856
  .pagelayer-dark .pagelayer-elpd-body option,
 
857
  .pagelayer-dark .pagelayer-elp-multiselect{
858
  color:#bdbdbd;
859
  }
@@ -1312,7 +1327,6 @@ z-index: 10;
1312
  }
1313
 
1314
  .pagelayer-elp-icon-selector,
1315
- .pagelayer-ele-type-sec,
1316
  .pagelayer-elp-link-list{
1317
  position: absolute;
1318
  z-index: 1000;
@@ -1332,8 +1346,7 @@ top: 40px;
1332
  right: 10px;
1333
  }
1334
 
1335
- .pagelayer-dark .pagelayer-elp-icon-selector,
1336
- .pagelayer-dark .pagelayer-ele-type-sec{
1337
  background: #252529 !important;
1338
  border: 1px solid #ffffff73 !important;
1339
  }
@@ -1502,10 +1515,25 @@ border-bottom: 1px solid #ccc !important;
1502
  position: relative;
1503
  }
1504
 
 
 
 
 
 
 
1505
  .pagelayer-elp-datetime{
1506
  width: 99%;
1507
  }
1508
 
 
 
 
 
 
 
 
 
 
1509
  .pagelayer-elp-fa-calendar{
1510
  position: absolute;
1511
  height: 40px;
@@ -1839,55 +1867,6 @@ z-index: 12;
1839
  background-color:#252529;
1840
  }
1841
 
1842
- .pagelayer-elp-typo-container{
1843
- max-height:250px;
1844
- overflow: auto;
1845
- }
1846
-
1847
- .pagelayer-elp-typo-sele{
1848
- width: 50%;
1849
- height: 24px;
1850
- display: inline-block;
1851
- vertical-align: middle;
1852
- border: 1px solid #ccc;
1853
- font-size: 12px;
1854
- padding: 0 2px;
1855
- box-sizing: border-box;
1856
- line-height: 24px;
1857
- border-radius: 4px;
1858
- cursor: pointer;
1859
- overflow: hidden;
1860
- white-space: nowrap;
1861
- }
1862
-
1863
- .pagelayer-dark .pagelayer-elp-typo-sele{
1864
- color:#bdbdbd;
1865
- border:1px solid #6e6d6d;
1866
- }
1867
-
1868
- .pagelayer-elp-typo-container span {
1869
- display: block;
1870
- font-size: 13px;
1871
- padding: 3px 2px;
1872
- border: 1px solid #ccc;
1873
- margin: 2px 0;
1874
- cursor: pointer;
1875
- }
1876
-
1877
- .pagelayer-dark .pagelayer-elp-typo-container span{
1878
- color:#bdbdbd;
1879
- }
1880
-
1881
- .pagelayer-elp-typo-search{
1882
- padding: 0 2px;
1883
- height: 24px;
1884
- line-height: 24px;
1885
- }
1886
-
1887
- .pagelayer-elp-typo-container span:hover{
1888
- background-color:#3E8EF7;
1889
- color:#ffffff;
1890
- }
1891
 
1892
  .pagelayer-prop-edit{
1893
  padding: 7px;
@@ -2013,6 +1992,10 @@ border-radius: 4px !important;
2013
  line-height: 23px !important;
2014
  }
2015
 
 
 
 
 
2016
  .pagelayer-elp-grad-color{
2017
  position:relative;
2018
  }
@@ -2025,6 +2008,10 @@ position:relative;
2025
  border-radius: 2px !important;
2026
  }
2027
 
 
 
 
 
2028
  .pagelayer-elp-text{
2029
  padding-left:5px;
2030
  }
@@ -2083,7 +2070,9 @@ outline: none;
2083
  font-weight:normal;
2084
  }
2085
 
2086
- .pagelayer-dark .pagelayer-elp-select-div .pagelayer-elp-select{
 
 
2087
  background-color: #252529;
2088
  color:#bdbdbd;
2089
  }
@@ -2389,7 +2378,9 @@ padding: 0px !important;
2389
  }
2390
 
2391
  .pagelayer-shortcode-text{
2392
- display: block;
 
 
2393
  font-family: Roboto, 'Open Sans', Arial, Helvetica, sans-serif;
2394
  font-size: 11px !important;
2395
  font-style: normal;
@@ -3642,5 +3633,196 @@ visibility:hidden;
3642
  animation: highlight 1s;
3643
  animation-iteration-count: 5;
3644
  }
3645
- /* Pagelayer post setting modal end*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3646
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  margin: 0px 5px 0px 0px;
530
  }
531
 
532
+ .pagelayer-elpd-tab:hover,
533
+ .pagelayer-history-tab:hover,
534
+ .pagelayer-widget-tab:hover{
535
+ color: #3e8ef7;
536
+ }
537
+
538
  .pagelayer-dark .pagelayer-elpd-tab,
539
  .pagelayer-dark .pagelayer-history-tab,
540
  .pagelayer-dark .pagelayer-widget-tab{
582
  [pagelayer-elpd-active-tab="1"],
583
  [pagelayer-history-active-tab="1"] {
584
  color: #3e8ef7;
585
+ border-bottom: 2px solid #3e8ef7;
586
  }
587
 
588
  .pagelayer-dark [pagelayer-elpd-active-tab="1"],
683
  line-height: 150%;
684
  }
685
 
686
+ .pagelayer-dark .pagelayer-elp-label,
687
+ .pagelayer-dark .pagelayer-post-category,
688
+ .pagelayer-dark .pagelayer-elp-postCategory,
689
+ .pagelayer-dark .pagelayer-elp-postdate::-webkit-datetime-edit-second-field{
690
  color:#bdbdbd;
691
  }
692
 
812
  width: 20px;
813
  height: 20px;
814
  cursor: pointer;
815
+ margin-left: 4px;
816
+ position: absolute;
817
+ top: 9px;
818
  }
819
 
820
  .pagelayer-elp-default:focus{
828
 
829
  /* Default button css ends */
830
 
831
+ .pagelayer-elp-desc, .pagelayer-elp-permalink-a{
832
+ color:#757575;
833
  font-size: 12px;
834
  line-height: 20px;
835
  font-style: italic;
836
  margin-top: 5px;
837
+ display:block;
838
  }
839
 
840
  .pagelayer-elpd-body input,
859
  .pagelayer-dark .pagelayer-elpd-body textarea,
860
  .pagelayer-dark .pagelayer-elpd-body select,
861
  .pagelayer-dark .pagelayer-elpd-body option,
862
+ .pagelayer-dark .pagelayer-add-cat-btn input,
863
  .pagelayer-dark .pagelayer-elp-multiselect{
864
  border:1px solid #6e6d6d;
865
  }
868
  .pagelayer-dark .pagelayer-elpd-body textarea,
869
  .pagelayer-dark .pagelayer-elpd-body select,
870
  .pagelayer-dark .pagelayer-elpd-body option,
871
+ .pagelayer-dark .pagelayer-add-cat-btn input,
872
  .pagelayer-dark .pagelayer-elp-multiselect{
873
  color:#bdbdbd;
874
  }
1327
  }
1328
 
1329
  .pagelayer-elp-icon-selector,
 
1330
  .pagelayer-elp-link-list{
1331
  position: absolute;
1332
  z-index: 1000;
1346
  right: 10px;
1347
  }
1348
 
1349
+ .pagelayer-dark .pagelayer-elp-icon-selector{
 
1350
  background: #252529 !important;
1351
  border: 1px solid #ffffff73 !important;
1352
  }
1515
  position: relative;
1516
  }
1517
 
1518
+ .pagelayer-elp-postdate-div{
1519
+ display: flex;
1520
+ border: 1px solid lightgrey;
1521
+ border-radius:3px;
1522
+ }
1523
+
1524
  .pagelayer-elp-datetime{
1525
  width: 99%;
1526
  }
1527
 
1528
+ .pagelayer-elp-postdate{
1529
+ border: none !important;
1530
+ outline: none;
1531
+ }
1532
+
1533
+ .pagelayer-elp-postdate::-webkit-calendar-picker-indicator {
1534
+ cursor: pointer;
1535
+ }
1536
+
1537
  .pagelayer-elp-fa-calendar{
1538
  position: absolute;
1539
  height: 40px;
1867
  background-color:#252529;
1868
  }
1869
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1870
 
1871
  .pagelayer-prop-edit{
1872
  padding: 7px;
1992
  line-height: 23px !important;
1993
  }
1994
 
1995
+ .pagelayer-dark .pagelayer-elp-typo select.pagelayer-elp-typo-input{
1996
+ background-color: #252529;
1997
+ }
1998
+
1999
  .pagelayer-elp-grad-color{
2000
  position:relative;
2001
  }
2008
  border-radius: 2px !important;
2009
  }
2010
 
2011
+ .pagelayer-post-type{
2012
+ text-transform: capitalize;
2013
+ }
2014
+
2015
  .pagelayer-elp-text{
2016
  padding-left:5px;
2017
  }
2070
  font-weight:normal;
2071
  }
2072
 
2073
+ .pagelayer-dark .pagelayer-elp-select-div .pagelayer-elp-select,
2074
+ .pagelayer-dark .pagelayer-elp-typo-input .pagelayer-elp-select,
2075
+ .pagelayer-dark .pagelayer-parent-category .pagelayer-add-cat{
2076
  background-color: #252529;
2077
  color:#bdbdbd;
2078
  }
2378
  }
2379
 
2380
  .pagelayer-shortcode-text{
2381
+ display: -webkit-box;
2382
+ -webkit-box-orient: vertical;
2383
+ -webkit-line-clamp: 3;
2384
  font-family: Roboto, 'Open Sans', Arial, Helvetica, sans-serif;
2385
  font-size: 11px !important;
2386
  font-style: normal;
3633
  animation: highlight 1s;
3634
  animation-iteration-count: 5;
3635
  }
3636
+ /* Pagelayer post setting modal end */
3637
+
3638
+ /* Pagelayer post props(category) start */
3639
+ .pagelayer-post-cat-div{
3640
+ max-height:300px;
3641
+ overflow:auto;
3642
+ }
3643
+
3644
+ .pagelayer-post-category, .pagelayer-post-category ul{
3645
+ list-style:none;
3646
+ padding:0;
3647
+ margin:0;
3648
+ margin-left:16px;
3649
+ }
3650
+
3651
+ .pagelayer-post-category li{
3652
+ margin:8px 0px;
3653
+ }
3654
+
3655
+ .pagelayer-post-category label, .pagelayer-elp-postCategory *{
3656
+ font-size:small;
3657
+ }
3658
+
3659
+ .pagelayer-post-category input[type=checkbox]{
3660
+ margin-right:5px;
3661
+ background-color:#007cba;
3662
+ width:16px;
3663
+ height:16px;
3664
+ }
3665
+
3666
+ .pagelayer-add-cat-btn{
3667
+ color:#0073aa;
3668
+ cursor:pointer;
3669
+ line-height:3;
3670
+ }
3671
+
3672
+ .pagelayer-add-cat-btn:hover{
3673
+ color:#00a0d2;
3674
+ }
3675
+
3676
+ .pagelayer-elp-postCategory input, .pagelayer-parent-category > select{
3677
+ margin-top:5px;
3678
+ margin-bottom:12px;
3679
+ }
3680
+
3681
+ .pagelayer-parent-category{
3682
+ margin-top:5px;
3683
+ }
3684
+
3685
+ .pagelayer-parent-category > select{
3686
+ height:32px;
3687
+ outline:none;
3688
+ }
3689
 
3690
+ .pagelayer-cat-submit{
3691
+ color: #007cba;
3692
+ border: 1px solid #007cba;
3693
+ padding: 10px;
3694
+ background-color: white;
3695
+ cursor: pointer;
3696
+ }
3697
+
3698
+ .pagelayer-cat-submit:hover{
3699
+ color: #006ba1;
3700
+ border: 1px solid #006ba1;
3701
+ }
3702
+
3703
+ .pagelayer-dark .pagelayer-cat-submit,
3704
+ .pagelayer-elp-postCategory input{
3705
+ background-color:transparent;
3706
+ }
3707
+
3708
+ .pagelayer-dark .pagelayer-cat-submit:hover{
3709
+ color:white;
3710
+ background-color:#007cba;
3711
+ }
3712
+
3713
+ /* Pagelayer post props(category) end */
3714
+ /* Pagelayer post props(tags) start */
3715
+
3716
+ .pagelayer-elp-postTags{
3717
+ border: 1px solid #757575;
3718
+ border-radius: 2px;
3719
+ display: flex;
3720
+ flex-wrap: wrap;
3721
+ padding:2px;
3722
+ }
3723
+
3724
+ .pagelayer-post-tags{
3725
+ display: flex;
3726
+ flex-wrap: wrap;
3727
+ align-items: flex-start;
3728
+ }
3729
+
3730
+ .pagelayer-elp-tags-ele{
3731
+ display: flex;
3732
+ margin: 2px 4px 2px 0;
3733
+ max-width: 100%;
3734
+ background-color: #ddd;
3735
+ border-radius: 2px;
3736
+ font-size: 13px;
3737
+ padding: 5px;
3738
+ }
3739
+
3740
+ .pagelayer-elp-tags-ele .pagelayer-tags-label{
3741
+ padding: 2px;
3742
+ }
3743
+
3744
+ .pagelayer-elp-tags-ele .pagelayer-elp-tags-remove{
3745
+ cursor:pointer;
3746
+ padding: 3px 5px;
3747
+ }
3748
+
3749
+ .pagelayer-elp-postTags-inp{
3750
+ width:auto;
3751
+ display: inline-block;
3752
+ flex: 1;
3753
+ padding: 5px;
3754
+ height: 26px;
3755
+ border: none !important;
3756
+ outline: none !important;
3757
+ max-width: 100%;
3758
+ min-height: 24px;
3759
+ min-width: 50px;
3760
+ background: inherit;
3761
+ color: #1e1e1e;
3762
+ box-shadow: none;
3763
+ margin-top:3px;
3764
+ }
3765
+
3766
+ .pagelayer-post-tags .pagelayer-postTags-list{
3767
+ flex: 1 0 100%;
3768
+ min-width: 100%;
3769
+ max-height: 9em;
3770
+ overflow-y: auto;
3771
+ transition: all .15s ease-in-out;
3772
+ list-style: none;
3773
+ border-top: 1px solid #757575;
3774
+ outline: none;
3775
+ border: none;
3776
+ margin: 0;
3777
+ margin-top:4px;
3778
+ padding:0;
3779
+ }
3780
+
3781
+
3782
+ .pagelayer-post-tags .pagelayer-postTags-list li{
3783
+ color: #757575;
3784
+ display: block;
3785
+ font-size: 13px;
3786
+ padding: 4px 8px;
3787
+ margin: 0;
3788
+ cursor: pointer;
3789
+ border-top: 1px solid #757575;
3790
+ }
3791
+
3792
+ .pagelayer-post-tags .pagelayer-postTags-list li:hover{
3793
+ color:white;
3794
+ background-color:#007cba;
3795
+ }
3796
+
3797
+ .pagelayer-elp-trash-button-div{
3798
+ text-align:center;
3799
+ }
3800
+
3801
+ .pagelayer-elp-trash-button{
3802
+ color: #cc1818;
3803
+ padding: 6px;
3804
+ white-space: nowrap;
3805
+ background: transparent;
3806
+ text-decoration: none;
3807
+ font-size: 13px;
3808
+ cursor: pointer;
3809
+ border: 1px solid #cc1818;
3810
+ border-radius: 2px;
3811
+ }
3812
+
3813
+ .pagelayer-elp-trash-button:hover{
3814
+ background-color: transparent;
3815
+ color: #710d0d;
3816
+ box-shadow: inset 0 0 0 1px #710d0d;
3817
+ }
3818
+
3819
+ .pagelayer-dark .pagelayer-elp-trash-button:hover{
3820
+ color:#ffffff;
3821
+ background-color: #cc1818;
3822
+ }
3823
+
3824
+
3825
+ .pagelayer-dark .pagelayer-elp-postdate-div .pagelayer-elp-postdate::-webkit-calendar-picker-indicator{
3826
+ filter: invert(70%);
3827
+ }
3828
+ /* Pagelayer post props(tags) end */
css/pagelayer-frontend.css CHANGED
@@ -328,6 +328,8 @@ max-width: 100%;
328
 
329
  .pagelayer-service-btn{
330
  display:inline-block;
 
 
331
  }
332
 
333
  .pagelayer-service-details{
@@ -2888,7 +2890,6 @@ margin-right: auto;
2888
 
2889
  .pagelayer-owl-stage-outer [class^="pagelayer-owl-"],
2890
  .pagelayer-owl-carousel .pagelayer-ele-wrap,
2891
- .pagelayer-slides-holder,
2892
  .pagelayer-owl-stage-outer{
2893
  height: 100%;
2894
  }
@@ -2945,6 +2946,7 @@ display:flex;
2945
  .pagelayer-email{
2946
  margin-top:auto;
2947
  margin-bottom:auto;
 
2948
  }
2949
 
2950
  /* Address and Number End */
@@ -3326,6 +3328,10 @@ white-space:normal !important;
3326
  /* Primary Menu End */
3327
 
3328
  /* Contact Form start */
 
 
 
 
3329
  .pagelayer-contact_item input,
3330
  .pagelayer-contact_item textarea,
3331
  .pagelayer-contact_item select{
328
 
329
  .pagelayer-service-btn{
330
  display:inline-block;
331
+ position:relative;
332
+ z-index:999;
333
  }
334
 
335
  .pagelayer-service-details{
2890
 
2891
  .pagelayer-owl-stage-outer [class^="pagelayer-owl-"],
2892
  .pagelayer-owl-carousel .pagelayer-ele-wrap,
 
2893
  .pagelayer-owl-stage-outer{
2894
  height: 100%;
2895
  }
2946
  .pagelayer-email{
2947
  margin-top:auto;
2948
  margin-bottom:auto;
2949
+ word-break:break-word;
2950
  }
2951
 
2952
  /* Address and Number End */
3328
  /* Primary Menu End */
3329
 
3330
  /* Contact Form start */
3331
+ .pagelayer-contact-form-note{
3332
+ margin-bottom:10px;
3333
+ }
3334
+
3335
  .pagelayer-contact_item input,
3336
  .pagelayer-contact_item textarea,
3337
  .pagelayer-contact_item select{
css/pagelayer-icons.css CHANGED
@@ -471,6 +471,9 @@ content: "\ea1e";
471
  .pagelayer-pl_breadcrumb:before{
472
  content: "\ea34";
473
  }
 
 
 
474
  .pli-circle-right:before {
475
  content: "\ea42";
476
  }
471
  .pagelayer-pl_breadcrumb:before{
472
  content: "\ea34";
473
  }
474
+ .pli-arrow-left:before{
475
+ content: "\f061";
476
+ }
477
  .pli-circle-right:before {
478
  content: "\ea42";
479
  }
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.8');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
@@ -17,9 +17,11 @@ define('PAGELAYER_DOCS', 'https://pagelayer.com/docs/');
17
  define('PAGELAYER_API', 'https://api.pagelayer.com/');
18
  define('PAGELAYER_SC_PREFIX', 'pl');
19
  define('PAGELAYER_YOUTUBE_BG', 'https://www.youtube.com/watch?v=Csa6rvCWmLU');
 
20
  define('PAGELAYER_BLOCK_PREFIX', defined('SITEPAD') ? 'sp' : 'wp');
21
  define('PAGELAYER_CMS_DIR_PREFIX', defined('SITEPAD') ? 'site' : 'wp');
22
  define('PAGELAYER_DEV', file_exists(dirname(__FILE__).'/dev.php') ? 1 : 0);
 
23
 
24
  include_once(PAGELAYER_DIR.'/main/functions.php');
25
  include_once(PAGELAYER_DIR.'/main/class.php');
@@ -118,6 +120,9 @@ function pagelayer_load_plugin(){
118
  $pagelayer->settings['body_font'] = get_option('pagelayer_body_font');
119
  $pagelayer->settings['color'] = get_option('pagelayer_color');
120
 
 
 
 
121
  // Load CSS settings
122
  foreach($pagelayer->css_settings as $k => $params){
123
  foreach($pagelayer->screens as $sk => $sv){
@@ -186,6 +191,15 @@ function pagelayer_load_plugin(){
186
  // Load the template builder
187
  include_once(PAGELAYER_DIR.'/main/template-builder.php');
188
 
 
 
 
 
 
 
 
 
 
189
  }else{
190
 
191
  // Show the promo
@@ -273,6 +287,9 @@ function pagelayer_admin_menu() {
273
 
274
  // Export Feature
275
  if(defined('PAGELAYER_PREMIUM')){
 
 
 
276
 
277
  // Export Theme
278
  add_submenu_page('pagelayer', __('Export Content into a Theme'), __('Export Theme'), $capability, 'pagelayer_template_export', 'pagelayer_builder_export');
@@ -624,7 +641,8 @@ function pagelayer_enqueue_fonts($suffix = '-header'){
624
  }
625
 
626
  $url = [];
627
-
 
628
  foreach($pagelayer->css as $k => $set){
629
 
630
  // Fetch body font if given
@@ -640,27 +658,59 @@ function pagelayer_enqueue_fonts($suffix = '-header'){
640
  }
641
 
642
  }
643
-
644
  foreach($pagelayer->runtime_fonts as $font => $weights){
645
- $v = $font.':'.implode(',', $weights);
646
- if(!in_array($v, $pagelayer->fonts_sent)){
647
- $url[] = $v;
648
- $pagelayer->fonts_sent[] = $v;
 
 
 
 
 
 
 
649
  }
650
  }
651
 
652
  // If no fonts are to be set, then we dont set
653
- if(empty($url)){
654
- return false;
 
 
 
 
 
 
 
 
 
655
  }
656
 
657
- $fonts_url = 'https://fonts.googleapis.com/css?family='.rawurlencode(implode('|', $url));
 
 
 
 
658
 
659
- wp_register_style('pagelayer-google-font'.$suffix, $fonts_url, array(), PAGELAYER_VERSION);
660
- wp_enqueue_style('pagelayer-google-font'.$suffix);
661
 
662
- echo '<link rel="preload" href="'.$fonts_url.'" as="fetch" crossorigin="anonymous">';
663
-
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  }
665
 
666
  // Load any header we have
@@ -978,9 +1028,11 @@ function pagelayer_clone_post(){
978
 
979
  unset($post->ID);
980
  $post->post_author = $new_post_author;
981
- $post->post_name = $post->post_name.'_clone';
982
  $post->post_status = 'draft';
983
  $post->post_title = $post->post_title.' Clone';
 
 
984
 
985
  $new_post_id = wp_insert_post( $post );
986
 
@@ -1004,7 +1056,7 @@ function pagelayer_clone_post(){
1004
  }
1005
 
1006
  // Finally, redirect to the edit post screen for the new draft
1007
- wp_redirect( pagelayer_livelink($new_post_id) );
1008
  exit;
1009
 
1010
  }
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');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
17
  define('PAGELAYER_API', 'https://api.pagelayer.com/');
18
  define('PAGELAYER_SC_PREFIX', 'pl');
19
  define('PAGELAYER_YOUTUBE_BG', 'https://www.youtube.com/watch?v=Csa6rvCWmLU');
20
+ define('PAGELAYER_CMS_NAME', defined('SITEPAD') ? 'SitePad' : 'WordPress');
21
  define('PAGELAYER_BLOCK_PREFIX', defined('SITEPAD') ? 'sp' : 'wp');
22
  define('PAGELAYER_CMS_DIR_PREFIX', defined('SITEPAD') ? 'site' : 'wp');
23
  define('PAGELAYER_DEV', file_exists(dirname(__FILE__).'/dev.php') ? 1 : 0);
24
+ define('PAGELAYER_FONT_POST_TYPE', 'pagelayer-fonts');
25
 
26
  include_once(PAGELAYER_DIR.'/main/functions.php');
27
  include_once(PAGELAYER_DIR.'/main/class.php');
120
  $pagelayer->settings['body_font'] = get_option('pagelayer_body_font');
121
  $pagelayer->settings['color'] = get_option('pagelayer_color');
122
 
123
+ // Any custom types
124
+ $pagelayer->settings['post_types'] = apply_filters('pagelayer_supported_post_type', $pagelayer->settings['post_types']);
125
+
126
  // Load CSS settings
127
  foreach($pagelayer->css_settings as $k => $params){
128
  foreach($pagelayer->screens as $sk => $sv){
191
  // Load the template builder
192
  include_once(PAGELAYER_DIR.'/main/template-builder.php');
193
 
194
+ $pagelayer->allowed_mime_type = array(
195
+ 'ttf' => 'font/ttf',
196
+ 'woff' => 'font/woff|application/font-woff|application/x-font-woff',
197
+ 'woff2' => 'font/woff2|font/x-woff2'
198
+ );
199
+
200
+ // Load the pagelayer custom fonts
201
+ include_once(PAGELAYER_DIR.'/main/custom_fonts.php');
202
+
203
  }else{
204
 
205
  // Show the promo
287
 
288
  // Export Feature
289
  if(defined('PAGELAYER_PREMIUM')){
290
+
291
+ // Add new template
292
+ add_submenu_page('pagelayer', __('Custom Fonts'), __('Custom Fonts'), $capability, 'edit.php?post_type='.PAGELAYER_FONT_POST_TYPE);
293
 
294
  // Export Theme
295
  add_submenu_page('pagelayer', __('Export Content into a Theme'), __('Export Theme'), $capability, 'pagelayer_template_export', 'pagelayer_builder_export');
641
  }
642
 
643
  $url = [];
644
+ $cst = [];
645
+
646
  foreach($pagelayer->css as $k => $set){
647
 
648
  // Fetch body font if given
658
  }
659
 
660
  }
661
+
662
  foreach($pagelayer->runtime_fonts as $font => $weights){
663
+ if(strpos($font, '_plf')){
664
+ if(!in_array($font, $pagelayer->fonts_sent)){
665
+ $pagelayer->fonts_sent[] = $font;
666
+ $cst[] = preg_replace('/_plf$/is', '', $font);
667
+ }
668
+ }else{
669
+ $v = $font.':'.implode(',', $weights);
670
+ if(!in_array($v, $pagelayer->fonts_sent)){
671
+ $url[] = $v;
672
+ $pagelayer->fonts_sent[] = $v;
673
+ }
674
  }
675
  }
676
 
677
  // If no fonts are to be set, then we dont set
678
+ if(!empty($url)){
679
+ $fonts_url = 'https://fonts.googleapis.com/css?family='.rawurlencode(implode('|', $url));
680
+
681
+ wp_register_style('pagelayer-google-font'.$suffix, $fonts_url, array(), PAGELAYER_VERSION);
682
+ wp_enqueue_style('pagelayer-google-font'.$suffix);
683
+
684
+ echo '<link rel="preload" href="'.$fonts_url.'" as="fetch" crossorigin="anonymous">';
685
+ }
686
+
687
+ if(empty($cst)){
688
+ return;
689
  }
690
 
691
+ $args = [
692
+ 'post_type' => PAGELAYER_FONT_POST_TYPE,
693
+ 'status' => 'publish',
694
+ 'post_name__in' => $cst
695
+ ];
696
 
697
+ //var_dump($args);
 
698
 
699
+ $query = get_posts($args);
700
+ //var_dump($query);
701
+
702
+ if(empty($query)){
703
+ return;
704
+ }
705
+
706
+ foreach($query as $font){
707
+ $meta_box_value = get_post_meta($font->ID, 'pagelayer_font_link', true);
708
+ if(empty($meta_box_value)){
709
+ continue;
710
+ }
711
+
712
+ echo '<style id="'.$font->post_name.'_plf" >@font-face { font-family: "'.$font->post_name.'_plf"'.'; src: url("'.$meta_box_value.'"); font-weight: 100 200 300 400 500 600 700 800 900;}</style>';
713
+ }
714
  }
715
 
716
  // Load any header we have
1028
 
1029
  unset($post->ID);
1030
  $post->post_author = $new_post_author;
1031
+ $post->post_name = '';
1032
  $post->post_status = 'draft';
1033
  $post->post_title = $post->post_title.' Clone';
1034
+ $post->post_date = '';
1035
+ $post->post_date_gmt = '';
1036
 
1037
  $new_post_id = wp_insert_post( $post );
1038
 
1056
  }
1057
 
1058
  // Finally, redirect to the edit post screen for the new draft
1059
+ wp_redirect( get_edit_post_link($new_post_id, '') );
1060
  exit;
1061
 
1062
  }
js/combined.js CHANGED
@@ -919,9 +919,24 @@ function pagelayer_contact_form(jEle){
919
  function pagelayer_contact_submit(jEle, e){
920
  e.preventDefault();
921
 
 
 
 
 
 
 
 
 
 
 
 
922
  // Trigger an action
923
  jQuery(document).trigger('pagelayer_contact_submit', e, jEle);
924
 
 
 
 
 
925
  //var fdata = jQuery(jEle).closest('form').serialize();
926
  var redirect = jQuery(jEle).find('input[name="cfa-redirect"]');
927
  var formData = new FormData( jQuery(jEle)[0] );
@@ -951,6 +966,9 @@ function pagelayer_contact_submit(jEle, e){
951
  success:function(result){
952
  var json = jQuery.parseJSON(result);
953
 
 
 
 
954
  if('success' in json){
955
  par.find(".pagelayer-message-"+msg_pos).addClass('pagelayer-cf-msg-suc').html(json['success']).fadeIn();
956
 
919
  function pagelayer_contact_submit(jEle, e){
920
  e.preventDefault();
921
 
922
+ // Checking for required checkboxes.
923
+ for(var checkbox_div of jQuery(jEle).find('.pagelayer-contact-checkbox')){
924
+ checkbox_div = jQuery(checkbox_div);
925
+ if(checkbox_div.attr('required') == 'required'){
926
+ if(pagelayer_empty(checkbox_div.find('input:checked').length)){
927
+ alert('Kindly select the required checkbox');
928
+ return;
929
+ }
930
+ }
931
+ }
932
+
933
  // Trigger an action
934
  jQuery(document).trigger('pagelayer_contact_submit', e, jEle);
935
 
936
+ // Disabling submit button with loading animation.
937
+ jQuery(jEle).find('.pagelayer-contact-submit-btn').prop('disabled', true);
938
+ jQuery(jEle).find('.pagelayer-contact-submit-btn .fa-spin').show('0.6');
939
+
940
  //var fdata = jQuery(jEle).closest('form').serialize();
941
  var redirect = jQuery(jEle).find('input[name="cfa-redirect"]');
942
  var formData = new FormData( jQuery(jEle)[0] );
966
  success:function(result){
967
  var json = jQuery.parseJSON(result);
968
 
969
+ jQuery(jEle).find('.pagelayer-contact-submit-btn').prop('disabled', false);
970
+ jQuery(jEle).find('.pagelayer-contact-submit-btn .fa-spin').hide('0.6');
971
+
972
  if('success' in json){
973
  par.find(".pagelayer-message-"+msg_pos).addClass('pagelayer-cf-msg-suc').html(json['success']).fadeIn();
974
 
js/givejs.php CHANGED
@@ -136,7 +136,7 @@ if(!empty($matches[1]) && function_exists('__pl')){
136
 
137
  // Also add the fonts
138
  if(!empty($pagelayer->fonts)){
139
- $export_langs['google_fonts_list'] = $pagelayer->fonts;
140
  }
141
 
142
  // And lang string ?
136
 
137
  // Also add the fonts
138
  if(!empty($pagelayer->fonts)){
139
+ $export_langs['pl_fonts_list'] = $pagelayer->fonts;
140
  }
141
 
142
  // And lang string ?
js/pagelayer-editor.js CHANGED
@@ -81,6 +81,9 @@ function pagelayer_start(){
81
  pagelayer_shortcodes['pl_inner_row'] = JSON.parse(JSON.stringify(pagelayer_shortcodes['pl_row']));
82
  pagelayer_shortcodes['pl_inner_row']['name'] = 'Inner Row';
83
  pagelayer_groups['grid'].push('pl_inner_row');
 
 
 
84
 
85
  // Make the Topbar
86
  pagelayer_bottombar();
@@ -113,7 +116,7 @@ function pagelayer_start(){
113
  pagelayer_set_screen_mode('desktop');
114
 
115
  // Create list of fonts
116
- pagelayer_fonts = pagelayer_l('google_fonts_list');
117
 
118
  // Set up right click
119
  pagelayer_left_click();
@@ -126,6 +129,9 @@ function pagelayer_start(){
126
  // Make a quick access of the props
127
  pagelayer_make_props_ref();
128
 
 
 
 
129
  // Do any actions here
130
  pagelayer_trigger_action('pagelayer_setup_history');
131
 
@@ -148,9 +154,91 @@ function pagelayer_start(){
148
  // Just the txt
149
  pagelayer.pro_txt = pagelayer_pro_txt;
150
 
 
 
 
 
 
 
151
  // Hide the loader
152
- pagelayer_loader_hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
 
156
  // Prevent the click Insite editor
@@ -170,6 +258,72 @@ function pagelayer_prevent_click(){
170
  });
171
  }
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  // Do pagelayer Dirty
174
  function pagelayer_do_dirty(){
175
 
@@ -568,6 +722,36 @@ function pagelayer_setup_drag(){
568
  if(sameTag.length > 0){
569
  onWrap = sameTag.closest('.pagelayer-wrap-ele');
570
  }*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
571
  }
572
  //console.log(onWrap);
573
 
@@ -1180,8 +1364,17 @@ function pagelayer_element_added(jEle){
1180
  var gProp = props[has_group['section']][has_group['prop']];
1181
 
1182
  for(var i=0; i < gProp['count']; i++){
1183
- var cid = pagelayer_element_add_child(jQuery("[pagelayer-id="+id+"]"), gProp['sc']);
1184
  //pagelayer_element_setup('[pagelayer-id='+cid+']', true);
 
 
 
 
 
 
 
 
 
1185
  }
1186
  }else{
1187
  pagelayer_sc_render(jQuery('[pagelayer-id="'+par_id+'"]'));
@@ -1210,7 +1403,9 @@ function pagelayer_element_added(jEle){
1210
  };
1211
 
1212
  // Add an element
1213
- function pagelayer_element_add_child(pEle, sc){
 
 
1214
  var child = pagelayer_create_sc(sc);
1215
  var cid = pagelayer_assign_id(child);
1216
  pagelayer_set_parent(child, pagelayer_assign_id(pEle));
@@ -1230,11 +1425,69 @@ function pagelayer_element_add_child(pEle, sc){
1230
 
1231
  pagelayer_element_setup('[pagelayer-id='+cid+']', true);
1232
 
1233
- // Certain element have editable areas which are inner rows. For UX we need to add columns for the users
1234
  if(sc == 'pl_inner_row'){
1235
- var col = jQuery('<div pagelayer-tag="pl_col"></div>');
1236
- jQuery('[pagelayer-id="'+id+'"]').find('.pagelayer-row-holder').append(col);
1237
- cid = pagelayer_onadd(col, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1238
  }
1239
 
1240
  // Do we have to create children ?
@@ -1244,7 +1497,7 @@ function pagelayer_element_add_child(pEle, sc){
1244
  var gProp = pagelayer_shortcodes[sc][has_group['section']][has_group['prop']];
1245
 
1246
  for(var i=0; i < gProp['count']; i++){
1247
- var in_cid = pagelayer_element_add_child(jQuery("[pagelayer-id="+cid+"]"), gProp['sc']);
1248
  }
1249
 
1250
  }
@@ -1409,7 +1662,12 @@ function pagelayer_element_setup(selector, render){
1409
  }
1410
 
1411
  }
1412
-
 
 
 
 
 
1413
  // Make the wraps
1414
  jEle.wrap('<div class="pagelayer-ele-wrap" pagelayer-wrap-id="'+id+'"></div>');
1415
  var wrap = jEle.parent();
@@ -1685,11 +1943,14 @@ function pagelayer_right_click(){
1685
  }else{
1686
  $contextMenu.find('.pagelayer-right-save-section').parent().hide();
1687
  }
 
 
 
1688
 
1689
  $contextMenu.css({
1690
  display: "block",
1691
- left: e.pageX,
1692
- top: e.pageY
1693
  });
1694
 
1695
  return false;
@@ -1706,7 +1967,12 @@ function pagelayer_set_parent(jEle, id){
1706
  jEle.attr('pagelayer-parent', id);
1707
  };
1708
 
1709
- // Set the parent for the group
 
 
 
 
 
1710
  function pagelayer_get_parent(jEle){
1711
  return jEle.attr('pagelayer-parent');
1712
  };
@@ -3520,6 +3786,40 @@ function pagelayer_get_contact_templates(){
3520
  return contacts_props;
3521
  }
3522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3523
  // Save the post
3524
  function pagelayer_save(){
3525
 
@@ -3532,7 +3832,13 @@ function pagelayer_save(){
3532
  var pagelayerajaxurl = pagelayer_ajax_url+'&action=pagelayer_save_content&postID='+pagelayer_postID;
3533
  var post = pagelayer_generate_sc(pagelayer_editable);//alert(post);return;
3534
 
 
 
3535
 
 
 
 
 
3536
  // Do we have contact templates ?
3537
  var contacts_props = pagelayer_get_contact_templates();
3538
 
@@ -3543,44 +3849,71 @@ function pagelayer_save(){
3543
  global_data = pagelayer_generate_sc_global_widget();
3544
  }
3545
 
3546
- jQuery.ajax({
3547
- type: "POST",
3548
- url: pagelayerajaxurl,
3549
- data: {
 
 
 
3550
  pagelayer_update_content : pagelayer_Base64.encode(post),
3551
  pagelayer_nonce: pagelayer_ajax_nonce,
3552
  global_widgets: global_data,
3553
  contacts: contacts_props,
3554
  post_status: pagelayer.post_status,
3555
  copyright: pagelayer_copyright
3556
- },
3557
- success: function(response, status, xhr){
3558
- //alert(data);
3559
- var obj = jQuery.parseJSON(response);
3560
- //alert(obj);
3561
- if(obj['error']){
3562
- alert(obj['error']);
3563
- }else{
3564
- pagelayer_do_undirty();
3565
- alert(obj['success']);
3566
- pagelayer_get_revision();
3567
- }
3568
- },
3569
- error: function(jqXHR, textStatus, errorThrown){
3570
- console.log(errorThrown);
3571
- alert('An error occured while saving ! Status : '+textStatus+' and Error : '+errorThrown);
3572
- },
3573
- complete: function(xhr,status){
3574
- pagelayer.$$('.pagelayer-update-text').show();
3575
- pagelayer.$$('.pagelayer-update-loader').hide();
3576
-
3577
- if(!pagelayer_empty(pagelayer.post_status)){
3578
- pagelayer.$$('.pagelayer-props-modal .pagelayer-meta-iframe').attr('src', pagelayer_post_props );
3579
- pagelayer.post_status = '';
3580
- }
3581
  }
3582
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3583
 
 
 
 
 
 
 
 
3584
  };
3585
 
3586
  //Close the Editor
@@ -3770,6 +4103,7 @@ function pagelayer_leftbar(){
3770
  '<div class="pagelayer-leftbar-scroll">'+
3771
  '<div id="pagelayer-shortcodes" class="pagelayer-leftbar-tab pagelayer-shortcodes">'+
3772
  '<div class="pagelayer-widget-tabs">'+
 
3773
  '<div class="pagelayer-widget-tab" pagelayer-widget-tab="widgets" pagelayer-elpd-active-tab=1>Widgets</div>'+
3774
  '<div class="pagelayer-widget-tab" pagelayer-widget-tab="global">Global</div>'+
3775
  '</div>'+
@@ -3871,30 +4205,12 @@ function pagelayer_leftbar(){
3871
  });
3872
 
3873
  // On click Pagelayer setting icon
3874
- pagelayer.$$('.pagelayer-settings-icon').click(function(event){
3875
  pagelayer_active = {};
3876
 
3877
  var pl_tag = jQuery(this).attr('pagelayer-tag') || 'pl_post_props';
3878
  var nModal = jQuery(this).attr('pagelayer-modal-none');
3879
 
3880
- if(pl_tag == 'pl_post_props' && pagelayer_empty(nModal) ){
3881
-
3882
- var propsModal = pagelayer.$$('.pagelayer-props-modal');
3883
-
3884
- if(propsModal.find('.pagelayer-meta-iframe').length < 1){
3885
- propsModal.find('.pagelayer-props-wrap').append('<iframe class="pagelayer-meta-iframe" src="'+ pagelayer_post_props +'" style="display:none"></iframe>');
3886
- propsModal.find('.pagelayer-meta-iframe').load(function(){
3887
- propsModal.find('.pagelayer-props-loading-screen').hide();
3888
- propsModal.find('.pagelayer-props-modal-close').css('visibility','visible');
3889
- jQuery(this).show();
3890
- });
3891
- }
3892
-
3893
- propsModal.show();
3894
- pagelayer.$$('.pagelayer-meta-iframe').contents().find('.pagelayer-tab-items[data-tab="post_props"]').click();
3895
- return;
3896
- }
3897
-
3898
  pagelayer_post_settings(pl_tag);
3899
 
3900
  });
@@ -3916,7 +4232,7 @@ function pagelayer_leftbar(){
3916
  });
3917
 
3918
 
3919
- // On click Pagelayer setting icon
3920
  var global_widget_list = function(){
3921
 
3922
  var gHtml = '';
@@ -4012,6 +4328,9 @@ function pagelayer_post_settings(pl_tag, to_click){
4012
  var id = pagelayer_id(jEle);
4013
  jQuery(pagelayer_editable).prepend(jEle);
4014
  pagelayer_element_setup('[pagelayer-id='+id+']', true);
 
 
 
4015
  }
4016
 
4017
  if(to_click){
@@ -4241,9 +4560,36 @@ function pagelayer_history_setup(force){
4241
  alert(obj['error']);
4242
  }else{
4243
 
 
 
 
 
 
 
 
 
 
4244
  // Set content
4245
  jQuery(pagelayer_editable).html(obj['content']);
4246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4247
  // Need to pass true to render table
4248
  pagelayer_element_setup('.pagelayer-ele', true);
4249
  pagelayer_add_widget();
@@ -5686,3 +6032,9 @@ function pagelayer_trim(str, charlist){
5686
 
5687
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
5688
  };
 
 
 
 
 
 
81
  pagelayer_shortcodes['pl_inner_row'] = JSON.parse(JSON.stringify(pagelayer_shortcodes['pl_row']));
82
  pagelayer_shortcodes['pl_inner_row']['name'] = 'Inner Row';
83
  pagelayer_groups['grid'].push('pl_inner_row');
84
+
85
+ // Removing post props options
86
+ pagelayer_setting_post_props();
87
 
88
  // Make the Topbar
89
  pagelayer_bottombar();
116
  pagelayer_set_screen_mode('desktop');
117
 
118
  // Create list of fonts
119
+ pagelayer_fonts = pagelayer_l('pl_fonts_list');
120
 
121
  // Set up right click
122
  pagelayer_left_click();
129
  // Make a quick access of the props
130
  pagelayer_make_props_ref();
131
 
132
+ // Post props exported defaults need to be updated
133
+ pagelayer_set_exported_defaults();
134
+
135
  // Do any actions here
136
  pagelayer_trigger_action('pagelayer_setup_history');
137
 
154
  // Just the txt
155
  pagelayer.pro_txt = pagelayer_pro_txt;
156
 
157
+ // Open post props on document load
158
+ pagelayer.$$('.pagelayer-settings').click();
159
+
160
+ // Open post props and Make elements editable to edit post props data
161
+ pagelayer_setup_props_editable();
162
+
163
  // Hide the loader
164
+ pagelayer_loader_hide();
165
+
166
+ }
167
+
168
+ // Post props attribute
169
+ function pagelayer_post_props_atts(prop, val, temp){
170
+
171
+ val = val || null;
172
+ temp = temp || false;
173
+
174
+ var proEle = jQuery(pagelayer_editable+' .pagelayer-post_props.pagelayer-ele').first();
175
+
176
+ if(!pagelayer_empty(temp)){
177
+ if(val === null){
178
+ return pagelayer_get_tmp_att(proEle, prop);
179
+ }
180
+
181
+ // Set the temp property as well
182
+ pagelayer_set_tmp_atts(proEle, prop, val);
183
+ return true;
184
+ }
185
 
186
+ if(val === null){
187
+ return pagelayer_get_att(proEle, prop);
188
+ }
189
+
190
+ // Set the property as well
191
+ pagelayer_set_atts(proEle, prop, val);
192
+ return true;
193
+ }
194
+
195
+ // Open post props and Make elements editable to edit post props data
196
+ function pagelayer_setup_props_editable(){
197
+
198
+ jQuery('[pagelayer-props-editable]').each(function(){
199
+ var jEle = jQuery(this);
200
+
201
+ // Skip element under the editable area
202
+ if (jEle.closest(pagelayer_editable).length > 0) {
203
+ return;
204
+ }
205
+
206
+ var prop = jEle.attr('pagelayer-props-editable');
207
+
208
+ // Make editable
209
+ jEle.attr('contenteditable', 'true');
210
+
211
+ // Reverse setup the event
212
+ jEle.on('focus', function(){
213
+ // Set the property as well
214
+ var data = pagelayer_post_props_atts(prop);
215
+ jEle.html(data);
216
+ });
217
+
218
+ // Reverse setup the event
219
+ jEle.on('input', function(){
220
+
221
+ var val = pagelayer_trim(jEle.html());
222
+
223
+ // Set the property as well
224
+ pagelayer_post_props_atts(prop, val);
225
+
226
+ // Update the property
227
+ var input = pagelayer.$$('[pagelayer-elp-name='+prop+']').find('input,textarea,.trumbowyg-editor');
228
+ //console.log(input);
229
+
230
+ if(input.length > 0){
231
+ if(input.hasClass('trumbowyg-editor')){
232
+ input.html(val);
233
+ }else{
234
+ input.val(val);
235
+ }
236
+ }
237
+
238
+ });
239
+
240
+ });
241
+
242
  }
243
 
244
  // Prevent the click Insite editor
258
  });
259
  }
260
 
261
+ // Removing post props options from the editor
262
+ function pagelayer_setting_post_props(){
263
+
264
+ if(pagelayer_empty(pagelayer_post_categories)){
265
+ delete pagelayer_shortcodes.pl_post_props.postCategory;
266
+ }
267
+
268
+ if(pagelayer_empty(pagelayer_post_tags)){
269
+ delete pagelayer_shortcodes.pl_post_props.postTags;
270
+ }
271
+
272
+ if(pagelayer_empty(pagelayer_shortcodes.pl_post_props.pageParent.post_parent.list)){
273
+ delete pagelayer_shortcodes.pl_post_props.pageParent;
274
+ }
275
+
276
+ if(pagelayer_post.post_type != 'post'){
277
+ delete pagelayer_shortcodes.pl_post_props.params.post_sticky;
278
+ }
279
+
280
+ if(pagelayer_empty(pagelayer_post_type_features['comments'])){
281
+ delete pagelayer_shortcodes.pl_post_props.postDiscussion.comment_status;
282
+ }
283
+
284
+ if(pagelayer_empty(pagelayer_post_type_features['trackbacks'])){
285
+ delete pagelayer_shortcodes.pl_post_props.postDiscussion.ping_status;
286
+ }
287
+
288
+ if(pagelayer_empty(pagelayer_shortcodes.pl_post_props.postDiscussion)){
289
+ delete pagelayer_shortcodes.pl_post_props.postDiscussion;
290
+ }
291
+
292
+ if(pagelayer_empty(pagelayer_post_type_features['excerpt'])){
293
+ delete pagelayer_shortcodes.pl_post_props.postExcerpt;
294
+ }
295
+
296
+ if(pagelayer_empty(pagelayer_post_type_features['thumbnail'])){
297
+ delete pagelayer_shortcodes.pl_post_props.postFeaturedImage;
298
+ }
299
+
300
+ if(pagelayer_empty(pagelayer_post_type_features['author'])){
301
+ delete pagelayer_shortcodes.pl_post_props.params.post_author;
302
+ }
303
+ }
304
+
305
+ // Set the default values of all default exported codes
306
+ function pagelayer_set_exported_defaults(){
307
+
308
+ // Set defaults for the exported variety
309
+ if(pagelayer_empty(pagelayer_default_params)){
310
+ return;
311
+ }
312
+
313
+ for(var tag in pagelayer_default_params){
314
+
315
+ for(var x in pagelayer_default_params[tag]){
316
+
317
+ if(x in pagelayer.props_ref[tag]){
318
+ pagelayer.props_ref[tag][x]['default'] = pagelayer_default_params[tag][x];
319
+ }
320
+
321
+ }
322
+
323
+ }
324
+
325
+ }
326
+
327
  // Do pagelayer Dirty
328
  function pagelayer_do_dirty(){
329
 
722
  if(sameTag.length > 0){
723
  onWrap = sameTag.closest('.pagelayer-wrap-ele');
724
  }*/
725
+
726
+ var widGroup = onWrap.closest('.pagelayer-ele-widget-group');
727
+
728
+ // If we are inside the group widget
729
+ if(widGroup.length > 0 && widGroup.closest(pagelayer_editable).length > 0){
730
+
731
+ var wGroupTag = pagelayer_tag(widGroup);
732
+ var use_inside = false;
733
+
734
+ // If defined use inside only
735
+ if('use_inside' in pagelayer_shortcodes[tag] && !pagelayer_empty(pagelayer_shortcodes[tag]['use_inside'])){
736
+
737
+ var inTags = pagelayer_shortcodes[tag]['use_inside'];
738
+
739
+ if(typeof inTags === 'string'){
740
+ inTags = [inTags];
741
+ }
742
+
743
+ for(var toFind in inTags){
744
+ if (wGroupTag == inTags[toFind]) {
745
+ use_inside = true;
746
+ }
747
+ }
748
+ }
749
+
750
+ // If we find nothing
751
+ if(!use_inside){
752
+ onWrap = widGroup.parent('.pagelayer-wrap-ele');
753
+ }
754
+ }
755
  }
756
  //console.log(onWrap);
757
 
1364
  var gProp = props[has_group['section']][has_group['prop']];
1365
 
1366
  for(var i=0; i < gProp['count']; i++){
1367
+ var cid = pagelayer_element_add_child(jQuery("[pagelayer-id="+id+"]"), gProp['sc'], gProp);
1368
  //pagelayer_element_setup('[pagelayer-id='+cid+']', true);
1369
+
1370
+ var cEle = pagelayer_ele_by_id(cid);
1371
+
1372
+ // Set default
1373
+ // This not set inner-row atts due to append col inside the row
1374
+ if( 'item_atts' in gProp && i in gProp['item_atts'] && !pagelayer_empty(gProp['item_atts'][i]) ){
1375
+ pagelayer_set_atts(cEle, gProp['item_atts'][i]);
1376
+ pagelayer_sc_render(cEle);
1377
+ }
1378
  }
1379
  }else{
1380
  pagelayer_sc_render(jQuery('[pagelayer-id="'+par_id+'"]'));
1403
  };
1404
 
1405
  // Add an element
1406
+ function pagelayer_element_add_child(pEle, sc, gProp){
1407
+
1408
+ gProp = gProp || {};
1409
  var child = pagelayer_create_sc(sc);
1410
  var cid = pagelayer_assign_id(child);
1411
  pagelayer_set_parent(child, pagelayer_assign_id(pEle));
1425
 
1426
  pagelayer_element_setup('[pagelayer-id='+cid+']', true);
1427
 
1428
+ // Certain element have editable areas iwhich are inner rows. For UX we need to add columns for the users
1429
  if(sc == 'pl_inner_row'){
1430
+
1431
+ var rHolder = pagelayer_ele_by_id(cid).find('.pagelayer-row-holder');
1432
+
1433
+ if( !pagelayer_empty(gProp) && 'inner_content' in gProp){
1434
+
1435
+ var inner_content = gProp['inner_content'];
1436
+
1437
+ // Add default element
1438
+ if(!pagelayer_empty(inner_content)){
1439
+
1440
+ var add_sc = function(hEle, _tag, content){
1441
+
1442
+ var dEle = jQuery('<div pagelayer-tag="'+_tag+'"></div>');
1443
+
1444
+ if(_tag == 'pl_col'){
1445
+ hEle = hEle.closest('.pagelayer-row-holder');
1446
+ }else{
1447
+ hEle = hEle.find('.pagelayer-col-holder');
1448
+ }
1449
+
1450
+ hEle.append(dEle);
1451
+ var curID = pagelayer_onadd(dEle, false);
1452
+ var curEle = pagelayer_ele_by_id(curID);
1453
+
1454
+ // Set default
1455
+ if('atts' in content[_tag]){
1456
+ pagelayer_set_atts(curEle, content[_tag]['atts']);
1457
+ pagelayer_sc_render(curEle);
1458
+ }
1459
+
1460
+ // Set inner content
1461
+ if('inner_content' in content[_tag]){
1462
+ for( var key in content[_tag]['inner_content'] ){
1463
+ for( var _key in content[_tag]['inner_content'][key] ){
1464
+ add_sc(curEle, _key, content[_tag]['inner_content'][key]);
1465
+ }
1466
+ }
1467
+ }
1468
+
1469
+ if(_tag == 'pl_col'){
1470
+ // TODO: unable to set col width
1471
+ pagelayer_renumber_col(hEle);
1472
+ }else{
1473
+ pagelayer_empty_col(hEle);
1474
+ }
1475
+ };
1476
+
1477
+ for( var key in inner_content ){
1478
+ for( var tag in inner_content[key] ){
1479
+ add_sc(rHolder, tag, inner_content[key]);
1480
+ }
1481
+ }
1482
+ }
1483
+
1484
+ pagelayer_empty_col(jQuery('[pagelayer-id="'+cid+'"]').find('.pagelayer-col-holder'));
1485
+
1486
+ }else{
1487
+ var col = jQuery('<div pagelayer-tag="pl_col"></div>');
1488
+ rHolder.append(col);
1489
+ cid = pagelayer_onadd(col, false);
1490
+ }
1491
  }
1492
 
1493
  // Do we have to create children ?
1497
  var gProp = pagelayer_shortcodes[sc][has_group['section']][has_group['prop']];
1498
 
1499
  for(var i=0; i < gProp['count']; i++){
1500
+ var in_cid = pagelayer_element_add_child(jQuery("[pagelayer-id="+cid+"]"), gProp['sc'], gProp);
1501
  }
1502
 
1503
  }
1662
  }
1663
 
1664
  }
1665
+
1666
+ // If is group of widget?
1667
+ if('widget_group' in pagelayer_shortcodes[tag] && !pagelayer_empty(pagelayer_shortcodes[tag]['widget_group'])){
1668
+ pagelayer_set_widget_group(jEle);
1669
+ }
1670
+
1671
  // Make the wraps
1672
  jEle.wrap('<div class="pagelayer-ele-wrap" pagelayer-wrap-id="'+id+'"></div>');
1673
  var wrap = jEle.parent();
1943
  }else{
1944
  $contextMenu.find('.pagelayer-right-save-section').parent().hide();
1945
  }
1946
+
1947
+ var hPosition = (e.pageX+$contextMenu.width()>jQuery(window).width()) ? (e.pageX-$contextMenu.width()) : e.pageX;
1948
+ var vPosition = (e.pageY+$contextMenu.height()>jQuery(document).scrollTop()+jQuery(window).height()) ? (e.pageY-$contextMenu.height()) : e.pageY;
1949
 
1950
  $contextMenu.css({
1951
  display: "block",
1952
+ left: hPosition,
1953
+ top: vPosition
1954
  });
1955
 
1956
  return false;
1967
  jEle.attr('pagelayer-parent', id);
1968
  };
1969
 
1970
+ // Set the widget group
1971
+ function pagelayer_set_widget_group(jEle){
1972
+ jEle.addClass('pagelayer-ele-widget-group');
1973
+ };
1974
+
1975
+ // Get the parent for the group
1976
  function pagelayer_get_parent(jEle){
1977
  return jEle.attr('pagelayer-parent');
1978
  };
3786
  return contacts_props;
3787
  }
3788
 
3789
+ // Save data or meta of the post
3790
+ function pagelayer_update_post_data(){
3791
+
3792
+ var tag = 'pl_post_props';
3793
+ var jEle = jQuery(pagelayer_editable+' [pagelayer-tag="'+tag+'"]');
3794
+
3795
+ if(jEle.length < 1){
3796
+ return;
3797
+ }
3798
+
3799
+ var tmp = pagelayer_data(jEle, true);
3800
+ var all_props = pagelayer_shortcodes[tag];
3801
+
3802
+ // Loop through all props
3803
+ for(var i in pagelayer_tabs){
3804
+
3805
+ var tab = pagelayer_tabs[i];
3806
+
3807
+ for(var section in all_props[tab]){
3808
+
3809
+ var props = section in pagelayer_shortcodes[tag] ? pagelayer_shortcodes[tag][section] : pagelayer_styles[section];
3810
+
3811
+ for(var x in props){
3812
+ //Set pagelayer POST data to send with save ajax
3813
+ if(x in tmp['atts']){
3814
+ pagelayer_ajax_post_data[x] = tmp['atts'][x];
3815
+ }else if(x in pagelayer_ajax_post_data){
3816
+ delete pagelayer_ajax_post_data[x];
3817
+ }
3818
+ }
3819
+ }
3820
+ }
3821
+ }
3822
+
3823
  // Save the post
3824
  function pagelayer_save(){
3825
 
3832
  var pagelayerajaxurl = pagelayer_ajax_url+'&action=pagelayer_save_content&postID='+pagelayer_postID;
3833
  var post = pagelayer_generate_sc(pagelayer_editable);//alert(post);return;
3834
 
3835
+ // Update data or meta of the post
3836
+ pagelayer_update_post_data();
3837
 
3838
+ if(pagelayer_empty(pagelayer.post_status) && !pagelayer_empty(pagelayer_ajax_post_data['post_status'])){
3839
+ pagelayer.post_status = pagelayer_ajax_post_data['post_status'];
3840
+ }
3841
+
3842
  // Do we have contact templates ?
3843
  var contacts_props = pagelayer_get_contact_templates();
3844
 
3849
  global_data = pagelayer_generate_sc_global_widget();
3850
  }
3851
 
3852
+ var cancel = function(){
3853
+ pagelayer.$$('.pagelayer-update-text').show();
3854
+ pagelayer.$$('.pagelayer-update-loader').hide();
3855
+ }
3856
+
3857
+ var save = function(){
3858
+ var post_data = {
3859
  pagelayer_update_content : pagelayer_Base64.encode(post),
3860
  pagelayer_nonce: pagelayer_ajax_nonce,
3861
  global_widgets: global_data,
3862
  contacts: contacts_props,
3863
  post_status: pagelayer.post_status,
3864
  copyright: pagelayer_copyright
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3865
  }
3866
+
3867
+ post_data = Object.assign(pagelayer_ajax_post_data, post_data);
3868
+
3869
+ jQuery.ajax({
3870
+ type: "POST",
3871
+ url: pagelayerajaxurl,
3872
+ data: post_data,
3873
+ success: function(response, status, xhr){
3874
+ //alert(data);
3875
+ var obj = jQuery.parseJSON(response);
3876
+ //alert(obj);
3877
+ if(obj['error']){
3878
+ alert(obj['error']);
3879
+ }else{
3880
+ alert(obj['success']);
3881
+ pagelayer_get_revision();
3882
+
3883
+ // Update the post status in the post_props, but first find if its actually there !
3884
+ var jEle = jQuery(pagelayer_editable).find("[pagelayer-tag=pl_post_props]");
3885
+ if(jEle.length > 0){
3886
+ var id = pagelayer_id(jEle);
3887
+ pagelayer_set_atts(jEle, 'post_status', obj['post_status']);
3888
+ pagelayer_trigger_action('pagelayer_save_success', obj['post_status']);
3889
+ }
3890
+
3891
+ pagelayer_do_undirty();
3892
+ }
3893
+ },
3894
+ error: function(jqXHR, textStatus, errorThrown){
3895
+ console.log(errorThrown);
3896
+ alert('An error occured while saving ! Status : '+textStatus+' and Error : '+errorThrown);
3897
+ },
3898
+ complete: function(xhr,status){
3899
+ pagelayer.$$('.pagelayer-update-text').show();
3900
+ pagelayer.$$('.pagelayer-update-loader').hide();
3901
+
3902
+ if(!pagelayer_empty(pagelayer.post_status)){
3903
+ pagelayer.$$('.pagelayer-props-modal .pagelayer-meta-iframe').attr('src', pagelayer_post_props );
3904
+ pagelayer.post_status = '';
3905
+ }
3906
+ }
3907
+ });
3908
+ }
3909
 
3910
+ // If the content is empty
3911
+ if(pagelayer_empty(post)){
3912
+ pagelayer_confirmation_box(pagelayer_l('empty_post_content'), save, cancel);
3913
+ return;
3914
+ }
3915
+
3916
+ save();
3917
  };
3918
 
3919
  //Close the Editor
4103
  '<div class="pagelayer-leftbar-scroll">'+
4104
  '<div id="pagelayer-shortcodes" class="pagelayer-leftbar-tab pagelayer-shortcodes">'+
4105
  '<div class="pagelayer-widget-tabs">'+
4106
+ '<div class="pagelayer-widget-tab pagelayer-settings" pagelayer-widget-tab="settings">Settings</div>'+
4107
  '<div class="pagelayer-widget-tab" pagelayer-widget-tab="widgets" pagelayer-elpd-active-tab=1>Widgets</div>'+
4108
  '<div class="pagelayer-widget-tab" pagelayer-widget-tab="global">Global</div>'+
4109
  '</div>'+
4205
  });
4206
 
4207
  // On click Pagelayer setting icon
4208
+ pagelayer.$$('.pagelayer-settings-icon, .pagelayer-settings').click(function(event){
4209
  pagelayer_active = {};
4210
 
4211
  var pl_tag = jQuery(this).attr('pagelayer-tag') || 'pl_post_props';
4212
  var nModal = jQuery(this).attr('pagelayer-modal-none');
4213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4214
  pagelayer_post_settings(pl_tag);
4215
 
4216
  });
4232
  });
4233
 
4234
 
4235
+ // On click Pagelayer setting icon
4236
  var global_widget_list = function(){
4237
 
4238
  var gHtml = '';
4328
  var id = pagelayer_id(jEle);
4329
  jQuery(pagelayer_editable).prepend(jEle);
4330
  pagelayer_element_setup('[pagelayer-id='+id+']', true);
4331
+
4332
+ // Dont mark as dirty as post_props is not editing anything
4333
+ pagelayer_do_undirty();
4334
  }
4335
 
4336
  if(to_click){
4560
  alert(obj['error']);
4561
  }else{
4562
 
4563
+ // Get the current post_name and post_status
4564
+ var props = jQuery(pagelayer_editable).find('.pagelayer-post_props');
4565
+ var post_name = '', post_status = '';
4566
+
4567
+ if(props.length > 0){
4568
+ post_name = pagelayer_get_att(props, 'post_name');
4569
+ post_status = pagelayer_get_att(props, 'post_status');
4570
+ }
4571
+
4572
  // Set content
4573
  jQuery(pagelayer_editable).html(obj['content']);
4574
 
4575
+ // Add previous post_name and post_status
4576
+ var props_new = jQuery(pagelayer_editable).find('.pagelayer-post_props');
4577
+ if(props_new.length > 0){
4578
+
4579
+ if(pagelayer_empty(post_name)){
4580
+ post_name = pagelayer_default_params.pl_post_props.post_name;
4581
+ }
4582
+
4583
+ if(pagelayer_empty(post_status)){
4584
+ post_status = pagelayer_default_params.pl_post_props.post_status;
4585
+ }
4586
+
4587
+ var tmp = {};
4588
+ tmp['post_name'] = post_name;
4589
+ tmp['post_status'] = post_status;
4590
+ pagelayer_set_atts(props_new, tmp);
4591
+ }
4592
+
4593
  // Need to pass true to render table
4594
  pagelayer_element_setup('.pagelayer-ele', true);
4595
  pagelayer_add_widget();
6032
 
6033
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
6034
  };
6035
+
6036
+ function pagelayer_ucwords(str) {
6037
+ return (str + '').replace(/^([a-z])|\s+([a-z])/g, function ($1) {
6038
+ return $1.toUpperCase();
6039
+ });
6040
+ }
js/pagelayer-frontend.js CHANGED
@@ -919,9 +919,24 @@ function pagelayer_contact_form(jEle){
919
  function pagelayer_contact_submit(jEle, e){
920
  e.preventDefault();
921
 
 
 
 
 
 
 
 
 
 
 
 
922
  // Trigger an action
923
  jQuery(document).trigger('pagelayer_contact_submit', e, jEle);
924
 
 
 
 
 
925
  //var fdata = jQuery(jEle).closest('form').serialize();
926
  var redirect = jQuery(jEle).find('input[name="cfa-redirect"]');
927
  var formData = new FormData( jQuery(jEle)[0] );
@@ -951,6 +966,9 @@ function pagelayer_contact_submit(jEle, e){
951
  success:function(result){
952
  var json = jQuery.parseJSON(result);
953
 
 
 
 
954
  if('success' in json){
955
  par.find(".pagelayer-message-"+msg_pos).addClass('pagelayer-cf-msg-suc').html(json['success']).fadeIn();
956
 
919
  function pagelayer_contact_submit(jEle, e){
920
  e.preventDefault();
921
 
922
+ // Checking for required checkboxes.
923
+ for(var checkbox_div of jQuery(jEle).find('.pagelayer-contact-checkbox')){
924
+ checkbox_div = jQuery(checkbox_div);
925
+ if(checkbox_div.attr('required') == 'required'){
926
+ if(pagelayer_empty(checkbox_div.find('input:checked').length)){
927
+ alert('Kindly select the required checkbox');
928
+ return;
929
+ }
930
+ }
931
+ }
932
+
933
  // Trigger an action
934
  jQuery(document).trigger('pagelayer_contact_submit', e, jEle);
935
 
936
+ // Disabling submit button with loading animation.
937
+ jQuery(jEle).find('.pagelayer-contact-submit-btn').prop('disabled', true);
938
+ jQuery(jEle).find('.pagelayer-contact-submit-btn .fa-spin').show('0.6');
939
+
940
  //var fdata = jQuery(jEle).closest('form').serialize();
941
  var redirect = jQuery(jEle).find('input[name="cfa-redirect"]');
942
  var formData = new FormData( jQuery(jEle)[0] );
966
  success:function(result){
967
  var json = jQuery.parseJSON(result);
968
 
969
+ jQuery(jEle).find('.pagelayer-contact-submit-btn').prop('disabled', false);
970
+ jQuery(jEle).find('.pagelayer-contact-submit-btn .fa-spin').hide('0.6');
971
+
972
  if('success' in json){
973
  par.find(".pagelayer-message-"+msg_pos).addClass('pagelayer-cf-msg-suc').html(json['success']).fadeIn();
974
 
js/properties.js CHANGED
@@ -55,9 +55,19 @@ function pagelayer_data(jEle, clean){
55
  for(var i in pagelayer_tabs){
56
 
57
  var tab = pagelayer_tabs[i];
58
-
 
59
  for(var section in all_props[tab]){
60
 
 
 
 
 
 
 
 
 
 
61
  var props = section in pagelayer_shortcodes[tag] ? pagelayer_shortcodes[tag][section] : pagelayer_styles[section];
62
 
63
  // In case of widgets its possible !
@@ -85,11 +95,11 @@ function pagelayer_data(jEle, clean){
85
 
86
  // If there is a unit and there is no unit suffix in atts value
87
  if('units' in prop){
88
- if(jQuery.isNumeric(prop['default'])){
89
- tmp_val = prop['default']+prop['units'][0];
90
  }else{
91
  var sep = 'sep' in prop ? prop['sep'] : ',';
92
- var tmp2 = prop['default'].split(sep);
93
  for(var k in tmp2){
94
  if(jQuery.isNumeric(tmp2[k])){
95
  tmp2[k] = tmp2[k]+prop['units'][0];
@@ -180,6 +190,7 @@ function pagelayer_elpd_setup(){
180
  '<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="settings" pagelayer-elpd-active-tab=1>Settings</div>'+
181
  //'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="styles">Style</div>'+
182
  '<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="options">Options</div>'+
 
183
  '<div class="pagelayer-elpd-options">'+
184
  '<i class="pli pli-clone" ></i>'+
185
  '<i class="pli pli-trashcan" ></i>'+
@@ -194,6 +205,7 @@ function pagelayer_elpd_setup(){
194
 
195
  pagelayer.$$('.pagelayer-elpd-close').on('click', function(){
196
  pagelayer_leftbar_tab('pagelayer-shortcodes');
 
197
  pagelayer.$$('.pagelayer-elpd-header').hide();
198
  pagelayer.$$('.pagelayer-logo').show();
199
  pagelayer.$$('.pagelayer-elpd-body').removeAttr('pagelayer-element-id').empty();
@@ -211,13 +223,40 @@ function pagelayer_elpd_setup(){
211
  //pagelayer.$$('.pagelayer-elpd-close').click();
212
  });
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  // The tabs
215
- pagelayer_elpd.find('.pagelayer-elpd-tab').on('click', function(){
 
 
216
  var attr = 'pagelayer-elpd-active-tab';
 
 
 
 
 
 
217
  pagelayer_elpd.find('.pagelayer-elpd-tab').each(function(){
218
  jQuery(this).removeAttr(attr);
219
  });
220
- jQuery(this).attr(attr, 1);
 
221
 
222
  // Trigger the showing of rows
223
  pagelayer_elpd_show_rows();
@@ -282,12 +321,24 @@ function pagelayer_elpd_generate(jEle, holder){
282
  for(var i in pagelayer_tabs){
283
  var tab = pagelayer_tabs[i];
284
  var section_close = false;// First section always open
 
 
285
  for(var section in all_props[tab]){
286
  //console.log(tab+' '+section);
287
-
 
 
 
 
 
 
 
 
 
288
  var props = section in pagelayer_shortcodes[el.tag] ? pagelayer_shortcodes[el.tag][section] : pagelayer_styles[section];
289
  //console.log(props);
290
 
 
291
  var sec = jQuery('<div class="pagelayer-elpd-section" section="'+section+'" pagelayer-show-tab="'+tab+'">'+
292
  '<div class="pagelayer-elpd-section-name '+sec_open_class+'"><i class="pli"></i>'+all_props[tab][section]+'</div>'+
293
  '<div class="pagelayer-elpd-section-rows"></div>'+
@@ -363,6 +414,13 @@ function pagelayer_elpd_generate(jEle, holder){
363
  pagelayer.$$('.pagelayer-elpd-options').removeClass('pagelayer-hidden');
364
  }
365
 
 
 
 
 
 
 
 
366
  // Section open close
367
  holder.find('>.pagelayer-elpd-section>.pagelayer-elpd-section-name').on('click', function(){
368
  var _sec = jQuery(this);
@@ -463,6 +521,10 @@ function pagelayer_elpd_render_row(row, prop){
463
 
464
  }
465
 
 
 
 
 
466
  return row;
467
  }
468
 
@@ -1174,8 +1236,8 @@ function pagelayer_elp_image(row, prop){
1174
  var style = '';
1175
  var tmp = prop.c['name']+'-url';
1176
  var def = pagelayer.blank_img;
1177
- var src = (tmp in prop.el.tmp) ? prop.el.tmp[tmp] : def;
1178
-
1179
  // Do we have a URL set ?
1180
  style = 'style="background-image:url(\''+src+'\')"';
1181
 
@@ -1195,6 +1257,16 @@ function pagelayer_elp_image(row, prop){
1195
 
1196
  row.append(div);
1197
 
 
 
 
 
 
 
 
 
 
 
1198
  // Set an Image
1199
  row.find('.pagelayer-elp-image').on('click', function(){
1200
 
@@ -1245,6 +1317,7 @@ function pagelayer_elp_image(row, prop){
1245
  button.css('background-image', 'url(\''+url+'\')');
1246
 
1247
  // Save and render
 
1248
  _pagelayer_set_tmp_atts(row, 'url', url);
1249
  _pagelayer_set_atts(row, id);
1250
 
@@ -1420,12 +1493,26 @@ function pagelayer_elp_multi_image(row, prop){
1420
  }
1421
 
1422
  // Do we have a URL set ?
1423
- if(ids.length > 0 && tmp in prop.el.tmp){
1424
- var images = JSON.parse(prop.el.tmp[tmp]);
1425
- //console.log(images);
1426
-
1427
- for(var x in ids){
1428
- row.find('.pagelayer-elp-multi_image-thumbs').append('<div class="pagelayer-elp-multi_image-thumb" style="background-image: url(\''+images['i'+ids[x]]+'\');"></div>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1429
  }
1430
  }
1431
 
@@ -2100,12 +2187,37 @@ function pagelayer_make_editable(jEle, e){
2100
  }
2101
  }
2102
 
2103
- /*// Reverse setup the event
2104
  jEle.on('blur', function(){
2105
  //pagelayer_editor[eId].pen.destroy();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2106
  });
2107
 
2108
- // Reverse setup the event
2109
  jEle.on('focus', function(){
2110
  //pagelayer_clear_editable(eId);
2111
  });*/
@@ -2521,7 +2633,7 @@ function pagelayer_elp_group(row, prop){
2521
  var pEle = jQuery('[pagelayer-id="'+ele_id+'"]');
2522
 
2523
  // First add the element inside the group element
2524
- var id = pagelayer_element_add_child(pEle, prop['sc']);
2525
  //pagelayer_element_setup('[pagelayer-id='+id+']', true);
2526
 
2527
  show_item(id);
@@ -3162,14 +3274,19 @@ function pagelayer_elp_gradient(row, prop){
3162
  function pagelayer_elp_font_family(row, prop){
3163
 
3164
  var options = '';
3165
- var option = function(val, lang){
3166
  var selected = (val != prop.c['val']) ? '' : 'selected="selected"';
3167
- var lang = pagelayer_empty(val) ? 'Default' : val;
3168
- return '<option class="pagelayer-elp-select-option" value="'+val+'" '+selected+'>'+lang+'</option>';
3169
  }
3170
-
3171
- for (x in pagelayer_fonts){
3172
- options += option(pagelayer_fonts[x], pagelayer_fonts[x]);
 
 
 
 
 
3173
  }
3174
 
3175
  var div = '<div class="pagelayer-elp-select-div pagelayer-elp-pos-rel">'+
@@ -3189,17 +3306,42 @@ function pagelayer_elp_font_family(row, prop){
3189
 
3190
  value = value.replace(' ', '+');
3191
 
3192
- if(jQuery('#pagelayer-google-fonts').length == 0){
3193
-
3194
- jQuery('head').append('<link id="pagelayer-google-fonts" href="https://fonts.googleapis.com/css?family='+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">');
3195
-
3196
- }else{
3197
-
3198
- var url = jQuery('#pagelayer-google-fonts').attr('href');
3199
- if(url.indexOf(value) == -1){
3200
- url = url+'|'+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
3201
- jQuery('#pagelayer-google-fonts').attr('href', url);
3202
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3203
 
3204
  }
3205
 
@@ -3234,28 +3376,31 @@ function pagelayer_elp_typography(row, prop){
3234
  return '<option value="'+val+'" '+selected+'>'+ lang +'</option>';
3235
  }
3236
 
3237
- var font_option = function(val, setVal){
 
3238
  var selected = (val != setVal) ? '' : 'selected="selected"';
3239
- var lang = pagelayer_empty(val) ? 'Default' : val;
3240
- return '<span value="'+val+'" '+selected+'>'+ lang +'</span>';
 
 
 
 
 
 
 
 
 
3241
  }
3242
 
3243
  var div = '<span class="pagelayer-prop-edit"><i class="pli pli-pencil"></i></span>'+
3244
  '<div class="pagelayer-elp-typo-div">'+
3245
  '<div class="pagelayer-elp-typo pagelayer-elp-typo-fonts">'+
3246
- '<label class="pagelayer-elp-label">'+pagelayer_l('font_family')+'</label>'+
3247
- '<div class="pagelayer-elp-typo-sele" data-val="'+val[0]+'">'+ ((val[0]=="") ? "Default" : val[0]) +'</div>'+
3248
- '<div class="pagelayer-ele-type-sec">'+
3249
- '<input class="pagelayer-elp-typo-search" placeholder="Search here..."></input>'+
3250
- '<div class="pagelayer-elp-typo-container">';
3251
-
3252
- jQuery.each(select['fonts'],function(key, value){
3253
- div += font_option(value, val[0]);
3254
- });
3255
 
3256
- div +='</div></div>'+
3257
- '</div>'+
3258
- '<div class="pagelayer-elp-typo pagelayer-elp-typo-size">'+
3259
  '<label class="pagelayer-elp-label">'+pagelayer_l('font_size')+'</label>'+
3260
  '<input class="pagelayer-elp-typo-input" type="number" max="200" min="0" step="1" value="'+val[1]+'"></input>'+
3261
  '</div>'+
@@ -3337,69 +3482,57 @@ function pagelayer_elp_typography(row, prop){
3337
  row.find('.pagelayer-elp-typo-div').toggleClass('pagelayer-prop-show');
3338
  });
3339
 
3340
- row.find('.pagelayer-elp-typo-sele').on('click', function(){
3341
- row.find('.pagelayer-ele-type-sec').slideToggle();
3342
- });
3343
-
3344
- row.find('.pagelayer-elp-typo-container').on('click', function(e){
3345
  var jEle = jQuery(e.target);
3346
- var set_val = jEle.attr('value');
3347
- (set_val == '') ? row.find('.pagelayer-elp-typo-sele').data('val',set_val).html('Default') : row.find('.pagelayer-elp-typo-sele').data('val',set_val).html(set_val);
3348
- row.find('.pagelayer-ele-type-sec').slideUp();
3349
- val = [];
3350
- val[0] = set_val;
3351
- row.find('.pagelayer-elp-typo-input').each(function(){
3352
- var value = jQuery(this).val();
3353
- val.push(value ? value : '');
3354
- });
3355
- _pagelayer_set_atts(row, val);
3356
- });
3357
-
3358
- row.find('.pagelayer-elp-typo-search').on('input', function(){
3359
- var val = jQuery(this).val().toLowerCase();
3360
- //console.log(val);
3361
- var html = '';
3362
- jQuery.each(select['fonts'],function(key, value){
3363
- //value = value.toLowerCase();
3364
- if(value.toLowerCase().includes(val)){
3365
- html += font_option(value, val[0]);
3366
- }
3367
- });
3368
- row.find('.pagelayer-elp-typo-container').html(html);
3369
 
3370
- });
3371
-
3372
-
3373
- row.find('.pagelayer-elp-typo-input').on('change', function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3374
  val = [];
3375
- val[0] = row.find('.pagelayer-elp-typo-sele').data('val');
3376
  row.find('.pagelayer-elp-typo-input').each(function(){
3377
  var value = jQuery(this).val();
3378
  val.push(value ? value : '');
3379
  });
3380
  _pagelayer_set_atts(row, val);
3381
- });
3382
-
3383
- row.find('.pagelayer-elp-typo-container').on('click', function(e){
3384
- var jEle = jQuery(e.target);
3385
- var value = jEle.attr('value');
3386
- value = value.replace(' ', '+');
3387
-
3388
- if(jQuery('#pagelayer-google-fonts').length == 0){
3389
- if(value==''){
3390
- return;
3391
- }
3392
- jQuery('head').append('<link id="pagelayer-google-fonts" href="https://fonts.googleapis.com/css?family='+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">');
3393
-
3394
- }else{
3395
-
3396
- var url = jQuery('#pagelayer-google-fonts').attr('href');
3397
- if(url.indexOf(value) == -1){
3398
- url = url+'|'+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
3399
- jQuery('#pagelayer-google-fonts').attr('href', url);
3400
- }
3401
-
3402
- }
3403
 
3404
  });
3405
 
@@ -3490,6 +3623,518 @@ function pagelayer_elp_dimension(row, prop){
3490
 
3491
  };
3492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3493
  // Select frame to upload media
3494
  function pagelayer_select_frame(tag, state){
3495
 
@@ -3616,7 +4261,7 @@ function pagelayer_show_default_button(row, prop, value){
3616
 
3617
  // Function which checks the properties to not to show default button
3618
  function pagelayer_properties_filter(property){
3619
- var propTypeDefault = ['image', 'text', 'editor', 'textarea', 'checkbox', 'access', 'modal', 'group', 'radio'];
3620
 
3621
  return (jQuery.inArray(property, propTypeDefault) == -1)
3622
  }
55
  for(var i in pagelayer_tabs){
56
 
57
  var tab = pagelayer_tabs[i];
58
+
59
+ section_loop1:
60
  for(var section in all_props[tab]){
61
 
62
+ // Any section to skip by post type ?
63
+ if(!pagelayer_empty(all_props['post_type_cats'])){
64
+ for(var post_type in all_props['post_type_cats']){
65
+ if(pagelayer_post.post_type != post_type && jQuery.inArray(section, all_props['post_type_cats'][post_type]) > -1){
66
+ continue section_loop1;
67
+ }
68
+ }
69
+ }
70
+
71
  var props = section in pagelayer_shortcodes[tag] ? pagelayer_shortcodes[tag][section] : pagelayer_styles[section];
72
 
73
  // In case of widgets its possible !
95
 
96
  // If there is a unit and there is no unit suffix in atts value
97
  if('units' in prop){
98
+ if(jQuery.isNumeric(tmp_val)){
99
+ tmp_val = tmp_val+prop['units'][0];
100
  }else{
101
  var sep = 'sep' in prop ? prop['sep'] : ',';
102
+ var tmp2 = tmp_val.split(sep);
103
  for(var k in tmp2){
104
  if(jQuery.isNumeric(tmp2[k])){
105
  tmp2[k] = tmp2[k]+prop['units'][0];
190
  '<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="settings" pagelayer-elpd-active-tab=1>Settings</div>'+
191
  //'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="styles">Style</div>'+
192
  '<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="options">Options</div>'+
193
+ '<div class="pagelayer-advanced-props pagelayer-elpd-tab pagelayer-hidden" pagelayer-elpd-tab="advanced">Advanced</div>'+
194
  '<div class="pagelayer-elpd-options">'+
195
  '<i class="pli pli-clone" ></i>'+
196
  '<i class="pli pli-trashcan" ></i>'+
205
 
206
  pagelayer.$$('.pagelayer-elpd-close').on('click', function(){
207
  pagelayer_leftbar_tab('pagelayer-shortcodes');
208
+ pagelayer.$$('[pagelayer-widget-tab="widgets"]').click();
209
  pagelayer.$$('.pagelayer-elpd-header').hide();
210
  pagelayer.$$('.pagelayer-logo').show();
211
  pagelayer.$$('.pagelayer-elpd-body').removeAttr('pagelayer-element-id').empty();
223
  //pagelayer.$$('.pagelayer-elpd-close').click();
224
  });
225
 
226
+ // The advanced props
227
+ pagelayer_elpd.find('.pagelayer-advanced-props').on('click', function(e){
228
+ e.preventDefault();
229
+ e.stopPropagation();
230
+ var propsModal = pagelayer.$$('.pagelayer-props-modal');
231
+ if(propsModal.find('.pagelayer-meta-iframe').length < 1){
232
+ propsModal.find('.pagelayer-props-wrap').append('<iframe class="pagelayer-meta-iframe" src="'+ pagelayer_post_props +'" style="display:none"></iframe>');
233
+ propsModal.find('.pagelayer-meta-iframe').load(function(){
234
+ propsModal.find('.pagelayer-props-loading-screen').hide();
235
+ propsModal.find('.pagelayer-props-modal-close').css('visibility','visible');
236
+ jQuery(this).show();
237
+ });
238
+ }
239
+
240
+ propsModal.show();
241
+ pagelayer.$$('.pagelayer-meta-iframe').contents().find('.pagelayer-tab-items[data-tab="post_props"]').click();
242
+ });
243
+
244
  // The tabs
245
+ pagelayer_elpd.find('.pagelayer-elpd-tab').on('click', function(){
246
+
247
+ var jEle = jQuery(this);
248
  var attr = 'pagelayer-elpd-active-tab';
249
+ var tab = jEle.attr('pagelayer-elpd-tab');
250
+
251
+ if(tab == 'advanced'){
252
+ return;
253
+ }
254
+
255
  pagelayer_elpd.find('.pagelayer-elpd-tab').each(function(){
256
  jQuery(this).removeAttr(attr);
257
  });
258
+
259
+ jEle.attr(attr, 1);
260
 
261
  // Trigger the showing of rows
262
  pagelayer_elpd_show_rows();
321
  for(var i in pagelayer_tabs){
322
  var tab = pagelayer_tabs[i];
323
  var section_close = false;// First section always open
324
+
325
+ section_loop2:
326
  for(var section in all_props[tab]){
327
  //console.log(tab+' '+section);
328
+
329
+ // Any section to skip by post type ?
330
+ if(!pagelayer_empty(all_props['post_type_cats'])){
331
+ for(var post_type in all_props['post_type_cats']){
332
+ if(pagelayer_post.post_type != post_type && jQuery.inArray(section, all_props['post_type_cats'][post_type]) > -1){
333
+ continue section_loop2;
334
+ }
335
+ }
336
+ }
337
+
338
  var props = section in pagelayer_shortcodes[el.tag] ? pagelayer_shortcodes[el.tag][section] : pagelayer_styles[section];
339
  //console.log(props);
340
 
341
+
342
  var sec = jQuery('<div class="pagelayer-elpd-section" section="'+section+'" pagelayer-show-tab="'+tab+'">'+
343
  '<div class="pagelayer-elpd-section-name '+sec_open_class+'"><i class="pli"></i>'+all_props[tab][section]+'</div>'+
344
  '<div class="pagelayer-elpd-section-rows"></div>'+
414
  pagelayer.$$('.pagelayer-elpd-options').removeClass('pagelayer-hidden');
415
  }
416
 
417
+ // Add Advanced settings options for the props
418
+ if(el.tag == 'pl_post_props'){
419
+ pagelayer.$$('.pagelayer-elpd-tab[pagelayer-elpd-tab="advanced"]').removeClass('pagelayer-hidden');
420
+ }else{
421
+ pagelayer.$$('.pagelayer-elpd-tab[pagelayer-elpd-tab="advanced"]').addClass('pagelayer-hidden');
422
+ }
423
+
424
  // Section open close
425
  holder.find('>.pagelayer-elpd-section>.pagelayer-elpd-section-name').on('click', function(){
426
  var _sec = jQuery(this);
521
 
522
  }
523
 
524
+ if('script' in prop){
525
+ row.append('<script>'+prop.script+'</script>');
526
+ }
527
+
528
  return row;
529
  }
530
 
1236
  var style = '';
1237
  var tmp = prop.c['name']+'-url';
1238
  var def = pagelayer.blank_img;
1239
+ var src = (tmp in prop.el.tmp) ? prop.el.tmp[tmp] : ((!pagelayer_empty(prop.c['val']) && prop.c['val'].search(/http(|s):\/\//i) == 0) ? prop.c['val'] : def );
1240
+
1241
  // Do we have a URL set ?
1242
  style = 'style="background-image:url(\''+src+'\')"';
1243
 
1257
 
1258
  row.append(div);
1259
 
1260
+ if(def == src && jQuery.isNumeric(prop.c['val'])){
1261
+ wp.media.attachment(prop.c['val']).fetch().then(function (data) {
1262
+ var fetch_url = wp.media.attachment(prop.c['val']).get('url')
1263
+ row.find('.pagelayer-elp-image').css('background-image', 'url(\''+fetch_url+'\')');
1264
+ _pagelayer_set_tmp_atts(row, 'url', fetch_url);
1265
+ }).fail(function(){
1266
+ row.find('.pagelayer-elp-image').css('background-image', 'url(\''+src+'\')')
1267
+ });
1268
+ }
1269
+
1270
  // Set an Image
1271
  row.find('.pagelayer-elp-image').on('click', function(){
1272
 
1317
  button.css('background-image', 'url(\''+url+'\')');
1318
 
1319
  // Save and render
1320
+ _pagelayer_set_tmp_atts(row, 'no-image-set', '');
1321
  _pagelayer_set_tmp_atts(row, 'url', url);
1322
  _pagelayer_set_atts(row, id);
1323
 
1493
  }
1494
 
1495
  // Do we have a URL set ?
1496
+ if(ids.length > 0){
1497
+ if(tmp in prop.el.tmp){
1498
+ var images = JSON.parse(prop.el.tmp[tmp]);
1499
+ //console.log(images);
1500
+
1501
+ for(var x in ids){
1502
+ row.find('.pagelayer-elp-multi_image-thumbs').append('<div class="pagelayer-elp-multi_image-thumb" style="background-image: url(\''+images['i'+ids[x]]+'\');"></div>');
1503
+ }
1504
+ }else{
1505
+ wp.media.query({ post__in: ids }).more().then(function(){
1506
+ // You attachments here normally
1507
+ // You can safely use any of them here
1508
+ // TODO: Set tmp here
1509
+ for(var x in ids){
1510
+ var fetch_url = wp.media.attachment(ids[x]).get('url');
1511
+ if(!pagelayer_empty(fetch_url)){
1512
+ row.find('.pagelayer-elp-multi_image-thumbs').append('<div class="pagelayer-elp-multi_image-thumb" style="background-image: url(\''+fetch_url+'\');"></div>');
1513
+ }
1514
+ }
1515
+ });
1516
  }
1517
  }
1518
 
2187
  }
2188
  }
2189
 
2190
+ // Reverse setup the event
2191
  jEle.on('blur', function(){
2192
  //pagelayer_editor[eId].pen.destroy();
2193
+
2194
+ var cEle = pEle;
2195
+
2196
+ // Do we have a parent ?
2197
+ var have_parent = function(Ele){
2198
+ var pId = pagelayer_get_parent(Ele);
2199
+
2200
+ if(pagelayer_empty(pId)){
2201
+ return;
2202
+ }
2203
+
2204
+ cEle = pagelayer_ele_by_id(pId);
2205
+ have_parent(cEle);
2206
+ }
2207
+
2208
+ have_parent(cEle);
2209
+
2210
+ var is_global = pagelayer_get_global_id(cEle);
2211
+
2212
+ if(pagelayer_empty(is_global)){
2213
+ return;
2214
+ }
2215
+
2216
+ pagelayer_sc_render(pEle);
2217
+
2218
  });
2219
 
2220
+ /*// Reverse setup the event
2221
  jEle.on('focus', function(){
2222
  //pagelayer_clear_editable(eId);
2223
  });*/
2633
  var pEle = jQuery('[pagelayer-id="'+ele_id+'"]');
2634
 
2635
  // First add the element inside the group element
2636
+ var id = pagelayer_element_add_child(pEle, prop['sc'], prop);
2637
  //pagelayer_element_setup('[pagelayer-id='+id+']', true);
2638
 
2639
  show_item(id);
3274
  function pagelayer_elp_font_family(row, prop){
3275
 
3276
  var options = '';
3277
+ var option = function(val, lang, type){
3278
  var selected = (val != prop.c['val']) ? '' : 'selected="selected"';
3279
+ var lang = pagelayer_empty(lang) ? 'Default' : lang;
3280
+ return '<option class="pagelayer-elp-select-option" value="'+val+'" type="'+type+'" '+selected+'>'+lang+'</option>';
3281
  }
3282
+
3283
+ for(y in pagelayer_fonts){
3284
+ if(y != 'default'){
3285
+ options += '<optgroup label="'+pagelayer_ucwords(y)+'">';
3286
+ }
3287
+ for (x in pagelayer_fonts[y]){
3288
+ options += option((jQuery.isNumeric(x) ? pagelayer_fonts[y][x] : x), pagelayer_fonts[y][x], y);
3289
+ }
3290
  }
3291
 
3292
  var div = '<div class="pagelayer-elp-select-div pagelayer-elp-pos-rel">'+
3306
 
3307
  value = value.replace(' ', '+');
3308
 
3309
+ switch(sEle.find("option:selected").attr('type')){
3310
+ case 'google':
3311
+ if(jQuery('#pagelayer-google-fonts').length == 0){
3312
+
3313
+ jQuery('head').append('<link id="pagelayer-google-fonts" href="https://fonts.googleapis.com/css?family='+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">');
3314
+
3315
+ }else{
3316
+
3317
+ var url = jQuery('#pagelayer-google-fonts').attr('href');
3318
+ if(url.indexOf(value) == -1){
3319
+ url = url+'|'+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
3320
+ jQuery('#pagelayer-google-fonts').attr('href', url);
3321
+ }
3322
+
3323
+ }
3324
+ break;
3325
+
3326
+ case 'custom':
3327
+ if(!pagelayer_empty(jQuery('style[id='+value+'_plf]').length)){
3328
+ break;
3329
+ }
3330
+ jQuery.ajax({
3331
+ url: pagelayer_ajax_url+'&action=pagelayer_custom_font',
3332
+ type: 'POST',
3333
+ dataType: 'json',
3334
+ data: {
3335
+ 'pagelayer_nonce': pagelayer_ajax_nonce,
3336
+ 'font_name': value
3337
+ },
3338
+ success: function(data) {
3339
+ if('style' in data){
3340
+ jQuery('body').append(data['style']);
3341
+ }
3342
+ }
3343
+ });
3344
+ break;
3345
 
3346
  }
3347
 
3376
  return '<option value="'+val+'" '+selected+'>'+ lang +'</option>';
3377
  }
3378
 
3379
+ var font_options = '';
3380
+ var font_option = function(val, lang, type, setVal){
3381
  var selected = (val != setVal) ? '' : 'selected="selected"';
3382
+ var lang = pagelayer_empty(lang) ? 'Default' : lang;
3383
+ return '<option class="pagelayer-elp-typo-sele-op" value="'+val+'" type="'+type+'" '+selected+'>'+lang+'</option>';
3384
+ }
3385
+
3386
+ for(y in select['fonts']){
3387
+ if(y != 'default'){
3388
+ font_options += '<optgroup label="'+pagelayer_ucwords(y)+'">';
3389
+ }
3390
+ for (x in select['fonts'][y]){
3391
+ font_options += font_option((jQuery.isNumeric(x) ? select['fonts'][y][x] : x), select['fonts'][y][x], y, val[0]);
3392
+ }
3393
  }
3394
 
3395
  var div = '<span class="pagelayer-prop-edit"><i class="pli pli-pencil"></i></span>'+
3396
  '<div class="pagelayer-elp-typo-div">'+
3397
  '<div class="pagelayer-elp-typo pagelayer-elp-typo-fonts">'+
3398
+ '<div class="pagelayer-elp-typo pagelayer-elp-typo-family">'+
3399
+ '<label class="pagelayer-elp-label">'+pagelayer_l('font_family')+'</label>'+
3400
+ '<select class="pagelayer-elp-typo-input pagelayer-elp-select" name="pagelayer-typo-select">'+font_options+'</select>'+
3401
+ '</div>';
 
 
 
 
 
3402
 
3403
+ div += '<div class="pagelayer-elp-typo pagelayer-elp-typo-size">'+
 
 
3404
  '<label class="pagelayer-elp-label">'+pagelayer_l('font_size')+'</label>'+
3405
  '<input class="pagelayer-elp-typo-input" type="number" max="200" min="0" step="1" value="'+val[1]+'"></input>'+
3406
  '</div>'+
3482
  row.find('.pagelayer-elp-typo-div').toggleClass('pagelayer-prop-show');
3483
  });
3484
 
3485
+ row.find('.pagelayer-elp-typo-input').on('change', function(e){
 
 
 
 
3486
  var jEle = jQuery(e.target);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3487
 
3488
+ var value = jEle.val();
3489
+ value = value.replace(' ', '+');
3490
+ var t = jEle.find("option:selected").attr('type');
3491
+
3492
+ switch(t){
3493
+ case 'google':
3494
+ if(jQuery('#pagelayer-google-fonts').length == 0){
3495
+ if(value==''){
3496
+ return;
3497
+ }
3498
+ jQuery('head').append('<link id="pagelayer-google-fonts" href="https://fonts.googleapis.com/css?family='+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">');
3499
+
3500
+ }else{
3501
+ var url = jQuery('#pagelayer-google-fonts').attr('href');
3502
+ if(url.indexOf(value) == -1){
3503
+ url = url+'|'+value+':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
3504
+ jQuery('#pagelayer-google-fonts').attr('href', url);
3505
+ }
3506
+ }
3507
+ break;
3508
+
3509
+ case 'custom':
3510
+ if(!pagelayer_empty(jQuery('style[id='+value+'_plf]').length)){
3511
+ break;
3512
+ }
3513
+ jQuery.ajax({
3514
+ url: pagelayer_ajax_url+'&action=pagelayer_custom_font',
3515
+ type: 'POST',
3516
+ dataType: 'json',
3517
+ data: {
3518
+ 'pagelayer_nonce': pagelayer_ajax_nonce,
3519
+ 'font_name': value
3520
+ },
3521
+ success: function(data) {
3522
+ if('style' in data){
3523
+ jQuery('body').append(data['style']);
3524
+ }
3525
+ }
3526
+ });
3527
+ break;
3528
+ }
3529
+
3530
  val = [];
 
3531
  row.find('.pagelayer-elp-typo-input').each(function(){
3532
  var value = jQuery(this).val();
3533
  val.push(value ? value : '');
3534
  });
3535
  _pagelayer_set_atts(row, val);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3536
 
3537
  });
3538
 
3623
 
3624
  };
3625
 
3626
+ // Post Category property
3627
+ function pagelayer_elp_postCategory(row, prop){
3628
+
3629
+ if(pagelayer_empty(pagelayer_post_categories)){
3630
+ return;
3631
+ }
3632
+
3633
+ // Placing the checked categories on the top.
3634
+ var checked_on_top = function(with_checkbox){
3635
+ var checked_list = '';
3636
+ var unchecked_list = '';
3637
+
3638
+ for(var list of jQuery(with_checkbox).children()){
3639
+ var temp = jQuery(list).find('input[checked=checked]');
3640
+ if(!pagelayer_empty(temp.length)){
3641
+ checked_list += list.outerHTML;
3642
+ }else{
3643
+ unchecked_list += list.outerHTML;
3644
+ }
3645
+ }
3646
+ return ('<div class="pagelayer-post-cat-div" ><ul class="pagelayer-post-category" >'+checked_list+unchecked_list+'</ul></div>');
3647
+ }
3648
+
3649
+ // For making insert new categories functionality.
3650
+ row.append(checked_on_top(pagelayer_post_categories.with_checkbox));
3651
+
3652
+ var div = '<div class="pagelayer-elp-postCategory">'+
3653
+ '<span class="pagelayer-add-cat-btn">Add New Category</span>'+
3654
+ '<form style="display:none;">'+
3655
+ '<div>'+
3656
+ '<label>New Category Name</label>'+
3657
+ '<input type="text" name="category_name" required>'+
3658
+ '</div>'+
3659
+ '<div>'+
3660
+ '<label>Parent Category</label>'+
3661
+ '<div class="pagelayer-parent-category"></div>'+
3662
+ '</div>'+
3663
+ '<button type="submit" class="pagelayer-cat-submit" >Add New Category</button>'+
3664
+ '</form>'+
3665
+ '</div>';
3666
+
3667
+ row.append(div);
3668
+
3669
+ // For making categories drop down options and adding an empty option.
3670
+ if(!pagelayer_empty(pagelayer_post_categories.without_checkbox)){
3671
+ var options = pagelayer_post_categories.without_checkbox.replace('>', '><option class="level-0" value="0">--No Parent--</option>');
3672
+ var options = jQuery(options);
3673
+ row.find('.pagelayer-parent-category').append(options);
3674
+ }
3675
+
3676
+ // For initiating ajax call when user create new category
3677
+ row.find('form').on('submit', function(e){
3678
+ e.preventDefault();
3679
+ jQuery.ajax({
3680
+ type: 'post',
3681
+ url: pagelayer_ajax_url+'&action=pagelayer_get_cat_checkboxes',
3682
+ dataType: 'json',
3683
+ data: {
3684
+ pagelayer_nonce: pagelayer_ajax_nonce,
3685
+ 'postid': pagelayer_postID,
3686
+ 'new_cat': row.find('form').serialize()
3687
+ },
3688
+ success: function(obj){
3689
+
3690
+ if(pagelayer_empty(obj)){
3691
+ return;
3692
+ }
3693
+
3694
+ if('error' in obj){
3695
+ alert(obj.error);
3696
+ }
3697
+
3698
+ if(!pagelayer_empty(obj.new_cat_id)){
3699
+ obj.with_checkbox = obj.with_checkbox.replace('value="'+obj.new_cat_id+'"', 'value="'+obj.new_cat_id+'" checked="checked"');
3700
+ }
3701
+
3702
+ var new_cat_elem = jQuery(obj.with_checkbox).find('input[value='+obj.new_cat_id+']').closest('li');
3703
+ var post_cat = row.find('.pagelayer-post-category');
3704
+
3705
+ // Does the new element have no parents ? Then prepend the <LI> to the existing list shown
3706
+ if(!pagelayer_empty(new_cat_elem.parent('.pagelayer-post-category').length)){
3707
+ post_cat.prepend(new_cat_elem);
3708
+ }else{
3709
+
3710
+ // Siblings are already there ?
3711
+ if(!pagelayer_empty(new_cat_elem.siblings().length)){
3712
+ post_cat.find('#'+new_cat_elem.parent().parent('li').attr('id')).children('ul').append(new_cat_elem);
3713
+ // No siblings, hence append
3714
+ }else{
3715
+ new_cat_elem = new_cat_elem.parent();
3716
+ post_cat.find('#'+new_cat_elem.closest('li').attr('id')).append(new_cat_elem);
3717
+ }
3718
+ post_cat.prepend(new_cat_elem.parents('li'));
3719
+ }
3720
+
3721
+ row.find('#pagelayer_cat_parent').replaceWith(obj.without_checkbox.replace('>', '><option class="level-0" value="0">--No Parent--</option>'));
3722
+
3723
+ row.find('input[name="category_name"]').val('');
3724
+ row.find('#pagelayer_cat_parent option[value="0"]').attr('selected', true);
3725
+ checked_cat(row.find('.pagelayer-post-cat-div'));
3726
+ event_function();
3727
+ }
3728
+ });
3729
+ });
3730
+
3731
+ // Show and hide 'Add new Category' button.
3732
+ row.find('.pagelayer-add-cat-btn').on('click', function(){
3733
+ row.find('form').toggle('fast');
3734
+ });
3735
+
3736
+ var checked_cat = function(elem){
3737
+ var jEle = elem.find('input:checked');
3738
+ var cat_array = [];
3739
+ for(var checked_input of jEle){
3740
+ cat_array.push(jQuery(checked_input).attr('value'));
3741
+ }
3742
+ _pagelayer_set_atts(row, cat_array);
3743
+ };
3744
+
3745
+ var event_function = function(){row.find('.pagelayer-post-cat-div').on('change', function(){
3746
+ checked_cat(jQuery(this));
3747
+ });
3748
+ };
3749
+ event_function();
3750
+ }
3751
+
3752
+ // Post tags property
3753
+ function pagelayer_elp_postTags(row, prop){
3754
+
3755
+ if(pagelayer_empty(pagelayer_post_tags)){
3756
+ return;
3757
+ }
3758
+
3759
+
3760
+ var div = '<div class="pagelayer-elp-postTags" >'+
3761
+ '<div class="pagelayer-post-tags" >'+
3762
+ '<input type="text" autocomplete="off" class="pagelayer-elp-postTags-inp" autofocus="autofocus"/>'+
3763
+ '<ul class="pagelayer-postTags-list" >'+
3764
+ '</ul>'+
3765
+ '</div>'+
3766
+ '</div>';
3767
+
3768
+ row.append(div);
3769
+
3770
+ // Single tag html
3771
+ var singleTag = function(tags){
3772
+ var html = '';
3773
+ jQuery.each(tags, function(index, value){
3774
+ html += '<span class="pagelayer-elp-tags-ele" data-val="'+value['term_id']+'"><span class="pagelayer-tags-label" >'+value['name']+'</span><span class="pagelayer-elp-tags-remove"><i class="fas fa-times"></i></span></span>';
3775
+ });
3776
+ return html;
3777
+ }
3778
+
3779
+ // Single list item html
3780
+ var singleLi= function(tags){
3781
+ var html = '';
3782
+ jQuery.each(tags, function(index, value){
3783
+ html += '<li data-val="'+value['term_id']+'">'+value['name']+'</li>';
3784
+ });
3785
+ return html;
3786
+ }
3787
+
3788
+ // For making new tags as well as removing using keyboard inputs.
3789
+ var keypresses = function(obj){
3790
+ row.find('.pagelayer-elp-postTags-inp').on('keydown', function(e){
3791
+ var val = e.target.value.trim();
3792
+ var keycode = (event.keyCode ? event.keyCode : event.which);
3793
+
3794
+ if(keycode == '13' || keycode == '188'){
3795
+
3796
+ for(var tag of obj.allTags){
3797
+ if(tag['name']==val){
3798
+ insertTags(val, tag['term_id']);
3799
+ return false;
3800
+ }
3801
+ }
3802
+
3803
+ jQuery.ajax({
3804
+ url: pagelayer_ajax_url+'&action=pagelayer_get_post_tags',
3805
+ type: 'post',
3806
+ dataType: 'json',
3807
+ data: {
3808
+ pagelayer_nonce: pagelayer_ajax_nonce,
3809
+ 'postid': pagelayer_postID,
3810
+ 'new_tag': val
3811
+ },
3812
+ success: function(resp){
3813
+ if(pagelayer_empty(resp)){
3814
+ return;
3815
+ }
3816
+ if('error' in resp){
3817
+ alert(resp.error);
3818
+ }
3819
+ if(!pagelayer_empty(resp.tag_id)){
3820
+ insertTags(val, resp.tag_id);
3821
+ tagSearching(resp);
3822
+ }
3823
+ }
3824
+ });
3825
+
3826
+ return false;
3827
+ }else if(keycode == '8'){
3828
+ if(!pagelayer_empty(val)){
3829
+ return true;
3830
+ }
3831
+ row.find('.pagelayer-post-tags').children('span').last().remove();
3832
+ selected_tags();
3833
+ }
3834
+ return true;
3835
+ });
3836
+ }
3837
+
3838
+ // Inserting tags in the Metabox.
3839
+ var insertTags = function(name, tag_id){
3840
+ var newItem = [];
3841
+ newItem[0] = {
3842
+ name:name,
3843
+ term_id:tag_id
3844
+ };
3845
+ row.find('.pagelayer-post-tags').children('input').before(singleTag(newItem));
3846
+ row.find('.pagelayer-elp-postTags .pagelayer-elp-postTags-inp').val('').focus();
3847
+ tag_remove();
3848
+ selected_tags();
3849
+ }
3850
+
3851
+ // Removing tags by clicking on the x button.
3852
+ var tag_remove = function(){
3853
+ row.find('.pagelayer-elp-tags-remove').each(function(){
3854
+ jQuery(this).on('click',function(){
3855
+ jQuery(this).parent().remove();
3856
+ selected_tags();
3857
+ });
3858
+ });
3859
+ }
3860
+
3861
+ // For searching tag name in the list of the fetched tags
3862
+ var tagSearching = function(obj){
3863
+ row.find('.pagelayer-elp-postTags-inp').off('keyup');
3864
+ row.find('.pagelayer-elp-postTags-inp').on("keyup", function() {
3865
+ var value = jQuery(this).val().toLowerCase();
3866
+
3867
+ var listUl = row.find('.pagelayer-postTags-list');
3868
+ listUl.empty();
3869
+
3870
+ if(value.length<2){
3871
+ return;
3872
+ }
3873
+
3874
+ var listValues = obj.allTags.filter(function(currentValue){
3875
+ if(currentValue.name.indexOf(this)>-1){
3876
+ var temp = false;
3877
+ var tags = row.find('.pagelayer-post-tags').children('span');
3878
+ for(var indi of tags){
3879
+ if(jQuery(indi).attr('data-val')==currentValue.term_id){
3880
+ temp = true;
3881
+ }
3882
+ }
3883
+ if(temp==false){
3884
+ return currentValue;
3885
+ }
3886
+ }
3887
+ }, value);
3888
+
3889
+ if(!pagelayer_empty(listValues.length)){
3890
+ listUl.append(singleLi(listValues));
3891
+ listUl.children().each(function(index, value){
3892
+ var ele = jQuery(this);
3893
+ ele.off('click');
3894
+ ele.on('click', function(){
3895
+ insertTags(ele.text(), ele.attr('data-val'));
3896
+ listUl.empty();
3897
+ });
3898
+ });
3899
+ }
3900
+
3901
+
3902
+ });
3903
+ }
3904
+
3905
+ row.find('.pagelayer-post-tags').prepend(singleTag(pagelayer_post_tags.postTags));
3906
+
3907
+ tagSearching(pagelayer_post_tags);
3908
+
3909
+ keypresses(pagelayer_post_tags);
3910
+
3911
+ tag_remove();
3912
+
3913
+ var selected_tags = function(){
3914
+ var jEle = row.find('.pagelayer-elp-postTags .pagelayer-elp-tags-ele');
3915
+ var tag_array = [];
3916
+ for(var selec_tag of jEle){
3917
+ tag_array.push(jQuery(selec_tag).text());
3918
+ }
3919
+ _pagelayer_set_atts(row, tag_array);
3920
+ };
3921
+ }
3922
+
3923
+ function pagelayer_elp_permalink(row, prop){
3924
+
3925
+ var tmp = '';
3926
+ var link = '';
3927
+
3928
+ if(!pagelayer_empty(pagelayer_permalink_structure)){
3929
+ tmp = pagelayer_post_permalink.replace(/\/$/,'');
3930
+ link = tmp.substring(0, tmp.lastIndexOf('/'));
3931
+
3932
+ var new_link = link+'/'+prop.c['val'];
3933
+ prop.default = pagelayer_post.post_name;
3934
+
3935
+ var div = '<div class="pagelayer-elp-text-div">'+
3936
+ '<input type="text" class="pagelayer-elp-text" name="'+prop.c['name']+'" value="'+pagelayer_htmlEntities(prop.c['val'])+'"></input>'+
3937
+ '<a href="'+pagelayer_post_permalink+'" class="pagelayer-elp-permalink-a" target="_blank" >'+new_link+'</a></p>'+
3938
+ '</div>';
3939
+ }else{
3940
+ var div = '<div class="pagelayer-elp-text-div">'+
3941
+ '<a href="'+pagelayer_post.guid+'" class="pagelayer-elp-permalink-a" target="_blank" >'+pagelayer_post.guid+'</a></p>'+
3942
+ '</div>';
3943
+ }
3944
+
3945
+ row.append(div);
3946
+
3947
+ setTimeout(function(){
3948
+ row.find(".pagelayer-post-type").html(pagelayer_post.post_type);
3949
+ }, 1000);
3950
+
3951
+ var string_to_slug = function (str){
3952
+ str = str.replace(/^\s+|\s+$/g, ''); // trim
3953
+ str = str.toLowerCase();
3954
+
3955
+ // remove accents, swap ñ for n, etc
3956
+ var char_map = {
3957
+ // Latin
3958
+ 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': 'C',
3959
+ 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', 'Ï': 'I',
3960
+ 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': 'O', 'Ő': 'O',
3961
+ 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH',
3962
+ 'ß': 'ss',
3963
+ 'à': 'a', 'á': 'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c',
3964
+ 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
3965
+ 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o',
3966
+ 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th',
3967
+ 'ÿ': 'y',
3968
+
3969
+ // Latin symbols
3970
+ '©': '(c)',
3971
+
3972
+ // Greek
3973
+ 'Α': 'A', 'Β': 'B', 'Γ': 'G', 'Δ': 'D', 'Ε': 'E', 'Ζ': 'Z', 'Η': 'H', 'Θ': '8',
3974
+ 'Ι': 'I', 'Κ': 'K', 'Λ': 'L', 'Μ': 'M', 'Ν': 'N', 'Ξ': '3', 'Ο': 'O', 'Π': 'P',
3975
+ 'Ρ': 'R', 'Σ': 'S', 'Τ': 'T', 'Υ': 'Y', 'Φ': 'F', 'Χ': 'X', 'Ψ': 'PS', 'Ω': 'W',
3976
+ 'Ά': 'A', 'Έ': 'E', 'Ί': 'I', 'Ό': 'O', 'Ύ': 'Y', 'Ή': 'H', 'Ώ': 'W', 'Ϊ': 'I',
3977
+ 'Ϋ': 'Y',
3978
+ 'α': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'ζ': 'z', 'η': 'h', 'θ': '8',
3979
+ 'ι': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': '3', 'ο': 'o', 'π': 'p',
3980
+ 'ρ': 'r', 'σ': 's', 'τ': 't', 'υ': 'y', 'φ': 'f', 'χ': 'x', 'ψ': 'ps', 'ω': 'w',
3981
+ 'ά': 'a', 'έ': 'e', 'ί': 'i', 'ό': 'o', 'ύ': 'y', 'ή': 'h', 'ώ': 'w', 'ς': 's',
3982
+ 'ϊ': 'i', 'ΰ': 'y', 'ϋ': 'y', 'ΐ': 'i',
3983
+
3984
+ // Turkish
3985
+ 'Ş': 'S', 'İ': 'I', 'Ç': 'C', 'Ü': 'U', 'Ö': 'O', 'Ğ': 'G',
3986
+ 'ş': 's', 'ı': 'i', 'ç': 'c', 'ü': 'u', 'ö': 'o', 'ğ': 'g',
3987
+
3988
+ // Russian
3989
+ 'А': 'A', 'Б': 'B', 'В': 'V', 'Г': 'G', 'Д': 'D', 'Е': 'E', 'Ё': 'Yo', 'Ж': 'Zh',
3990
+ 'З': 'Z', 'И': 'I', 'Й': 'J', 'К': 'K', 'Л': 'L', 'М': 'M', 'Н': 'N', 'О': 'O',
3991
+ 'П': 'P', 'Р': 'R', 'С': 'S', 'Т': 'T', 'У': 'U', 'Ф': 'F', 'Х': 'H', 'Ц': 'C',
3992
+ 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sh', 'Ъ': '', 'Ы': 'Y', 'Ь': '', 'Э': 'E', 'Ю': 'Yu',
3993
+ 'Я': 'Ya',
3994
+ 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'ж': 'zh',
3995
+ 'з': 'z', 'и': 'i', 'й': 'j', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
3996
+ 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'c',
3997
+ 'ч': 'ch', 'ш': 'sh', 'щ': 'sh', 'ъ': '', 'ы': 'y', 'ь': '', 'э': 'e', 'ю': 'yu',
3998
+ 'я': 'ya',
3999
+
4000
+ // Ukrainian
4001
+ 'Є': 'Ye', 'І': 'I', 'Ї': 'Yi', 'Ґ': 'G',
4002
+ 'є': 'ye', 'і': 'i', 'ї': 'yi', 'ґ': 'g',
4003
+
4004
+ // Czech
4005
+ 'Č': 'C', 'Ď': 'D', 'Ě': 'E', 'Ň': 'N', 'Ř': 'R', 'Š': 'S', 'Ť': 'T', 'Ů': 'U',
4006
+ 'Ž': 'Z',
4007
+ 'č': 'c', 'ď': 'd', 'ě': 'e', 'ň': 'n', 'ř': 'r', 'š': 's', 'ť': 't', 'ů': 'u',
4008
+ 'ž': 'z',
4009
+
4010
+ // Polish
4011
+ 'Ą': 'A', 'Ć': 'C', 'Ę': 'e', 'Ł': 'L', 'Ń': 'N', 'Ó': 'o', 'Ś': 'S', 'Ź': 'Z',
4012
+ 'Ż': 'Z',
4013
+ 'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's', 'ź': 'z',
4014
+ 'ż': 'z',
4015
+
4016
+ // Latvian
4017
+ 'Ā': 'A', 'Č': 'C', 'Ē': 'E', 'Ģ': 'G', 'Ī': 'i', 'Ķ': 'k', 'Ļ': 'L', 'Ņ': 'N',
4018
+ 'Š': 'S', 'Ū': 'u', 'Ž': 'Z',
4019
+ 'ā': 'a', 'č': 'c', 'ē': 'e', 'ģ': 'g', 'ī': 'i', 'ķ': 'k', 'ļ': 'l', 'ņ': 'n',
4020
+ 'š': 's', 'ū': 'u', 'ž': 'z'
4021
+ };
4022
+
4023
+ for(var k in char_map) {
4024
+ str = str.replace(new RegExp(k, 'g'), char_map[k]);
4025
+ }
4026
+
4027
+ str = str.replace('.', '-')// replace a dot by a dash
4028
+ .replace(/[^a-z0-9 -]/g, '') // remove invalid chars
4029
+ .replace(/\s+/g, '-') // collapse whitespace and replace by a dash
4030
+ .replace(/-+/g, '-') // collapse dashes
4031
+ .replace( /\//g, '' ); // collapse all forward-slashes
4032
+
4033
+ return str;
4034
+ }
4035
+
4036
+ var editSlug = function(jEle, val){
4037
+
4038
+ // Convert to slug
4039
+ val = string_to_slug(val);
4040
+
4041
+ var new_link = link+'/'+val;
4042
+ var a = row.find('a');
4043
+ a.html(new_link);
4044
+ jEle.val(val);
4045
+
4046
+ return val;
4047
+ }
4048
+
4049
+ var input = row.find('input');
4050
+
4051
+ if(pagelayer_empty(prop.c['val'])){
4052
+ editSlug(input, pagelayer_post.post_title);
4053
+
4054
+ input.on('focusin', function(){
4055
+ if(!pagelayer_empty(pagelayer_get_att(prop.el.$, prop.c['name']))){
4056
+ return;
4057
+ }
4058
+
4059
+ editSlug(input, pagelayer_get_att(prop.el.$, 'post_title'));
4060
+ });
4061
+ }
4062
+
4063
+ input.on('focusout', function(){
4064
+ var val = jQuery(this).val();
4065
+ val = editSlug(jQuery(this), val);
4066
+
4067
+ if(pagelayer_empty(pagelayer_get_att(prop.el.$, prop.c['name']))){
4068
+ return;
4069
+ }
4070
+ _pagelayer_set_atts(row, val);// Save and Render
4071
+ });
4072
+
4073
+ input.on('input', function(){
4074
+ var new_link = link+'/'+jQuery(this).val();
4075
+ var a = row.find('a');
4076
+ a.html(new_link);
4077
+ _pagelayer_set_atts(row, jQuery(this).val());// Save and Render
4078
+ });
4079
+ }
4080
+
4081
+ // The Datetime Property
4082
+ function pagelayer_elp_postDate(row, prop){
4083
+
4084
+ var date_array = prop.c['val'].split(" ");
4085
+
4086
+ var div = '<div class="pagelayer-elp-postdate-div">'+
4087
+ '<input type="date" class="pagelayer-elp-postdate" name="'+prop.c['name']+'" value="'+date_array[0]+'" />'+
4088
+ '<input type="time" class="pagelayer-elp-postdate" name="'+prop.c['name']+'" value="'+date_array[1]+'" />'+
4089
+ '</div>';
4090
+
4091
+ row.append(div);
4092
+
4093
+ row.find('.pagelayer-elp-postdate-div').on('change', function(){
4094
+ var date_string = jQuery(this).children().eq(0).val() +' '+ jQuery(this).children().eq(1).val();
4095
+ _pagelayer_set_atts(row, date_string);// Save and Render
4096
+ });
4097
+
4098
+ };
4099
+
4100
+ // The button Property
4101
+ function pagelayer_elp_trashButton(row, prop){
4102
+
4103
+ var div = '<div class="pagelayer-elp-trash-button-div">'+
4104
+ '<button class="pagelayer-elp-trash-button">Move to trash</button>'+
4105
+ '</div>';
4106
+
4107
+ row.append(div);
4108
+
4109
+ row.find('.pagelayer-elp-trash-button').on('click', function(event){
4110
+ event.preventDefault();
4111
+ if(!confirm(pagelayer_l('delete_post_conf'))){
4112
+ return;
4113
+ }
4114
+ //console.log(pagelayer_postID);
4115
+ jQuery.ajax({
4116
+ url: pagelayer_ajax_url+'&action=pagelayer_trash_post',
4117
+ type: 'post',
4118
+ dataType: 'json',
4119
+ data: {
4120
+ pagelayer_nonce: pagelayer_ajax_nonce,
4121
+ 'postid': pagelayer_postID
4122
+ },
4123
+ success: function(resp){
4124
+
4125
+ if('error' in resp){
4126
+ alert(resp.error);
4127
+ }
4128
+
4129
+ if('url' in resp){
4130
+ window.top.location.href = resp.url;
4131
+ }
4132
+ }
4133
+ });
4134
+ });
4135
+
4136
+ };
4137
+
4138
  // Select frame to upload media
4139
  function pagelayer_select_frame(tag, state){
4140
 
4261
 
4262
  // Function which checks the properties to not to show default button
4263
  function pagelayer_properties_filter(property){
4264
+ var propTypeDefault = ['image', 'text', 'editor', 'textarea', 'checkbox', 'access', 'modal', 'group', 'radio', 'postCategory', 'postTags', 'postDate'];
4265
 
4266
  return (jQuery.inArray(property, propTypeDefault) == -1)
4267
  }
js/widgets.js CHANGED
@@ -371,7 +371,7 @@ function pagelayer_render_pl_service(el){
371
  function pagelayer_render_end_pl_service(el){
372
  // Drag and Drop function for image
373
  if (typeof pagelayer_preDAndD_image !== "undefined") {
374
- pagelayer_preDAndD_image(el.$);
375
  }
376
  }
377
 
@@ -707,20 +707,27 @@ function pagelayer_render_html_pl_featured_img(el){
707
  url: pagelayer_ajax_url+'action=pagelayer_fetch_featured_img',
708
  type: 'post',
709
  data: param,
 
710
  success: function(data){
711
 
712
  var src = '';
 
 
713
  if(pagelayer_empty(data)){
714
  src = el.tmp['img-'+el.atts['size']+'-url'] || el.tmp['img-url'];
715
  src = src || el.atts['img'];
716
  }else{
717
- src = data;
718
- //url = el.atts['img-url'];
 
 
 
 
719
  }
720
 
721
  var img_html = '<img class="pagelayer-img" src="'+pagelayer.blank_img+'" />';
722
  if(src){
723
- img_html = '<img class="pagelayer-img" src="'+src+'" />';
724
  }
725
 
726
  el.$.find('.pagelayer-featured-img').html(img_html);
@@ -756,16 +763,16 @@ var pagelayer_posts_data = {};
756
  function pagelayer_compare_object(obj1, obj2){
757
  var objectsAreSame = true;
758
  for(var propertyName in obj1){
759
- if(obj1[propertyName] !== obj2[propertyName]){
760
- objectsAreSame = false;
761
- break;
762
- }
763
  }
764
  for(var propertyName in obj2){
765
- if(obj1[propertyName] !== obj2[propertyName]){
766
- objectsAreSame = false;
767
- break;
768
- }
769
  }
770
  return objectsAreSame;
771
  }
@@ -1017,7 +1024,7 @@ function pagelayer_render_pl_contact_item(el){
1017
  }
1018
 
1019
  if(el.atts['field_type'] == 'select'){
1020
- html += '<select name="'+el.atts['field_name']+'" '+required+'>'
1021
  if(!pagelayer_empty(el.atts['label_name']) && !pagelayer_empty(el.atts['label_as_holder'])){
1022
  html += '<option value="" disabled selected>'+el.atts['label_name']+'</option>';
1023
  }else{
@@ -1034,10 +1041,10 @@ function pagelayer_render_pl_contact_item(el){
1034
  }else if(el.atts['field_type'] == 'checkbox'){
1035
  if(!pagelayer_empty(el.atts['values'])){
1036
  options = el.atts['values'].split("\n");
1037
- html += '<div class="pagelayer-radcheck-holder">';
1038
  for(var x in options){
1039
- html += '<div><input type="checkbox" id="'+options[x].trim()+'" name="'+el.atts['field_name']+'[]" '+
1040
- 'value="'+options[x].trim()+'" '+required+'/><label for="'+options[x].trim()+'" class="pagelayer-form-label">'+options[x].trim()+'</label></div>';
1041
  }
1042
  html += '</div>';
1043
  }
@@ -1118,7 +1125,13 @@ function pagelayer_render_end_pl_countdown(el){
1118
  }else{
1119
  jEle.removeAttr('display_expired_text', exp);
1120
  }
1121
- pagelayer_countdown(jEle);
 
 
 
 
 
 
1122
  }
1123
 
1124
  // Render the share
@@ -1220,6 +1233,19 @@ function pagelayer_render_end_pl_anim_heading(el){
1220
  pagelayer_anim_heading(jEle);
1221
  }
1222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1223
  // Mega Menu popup handler
1224
  pagelayer_add_action('pagelayer_setup_history', function(){
1225
 
@@ -1229,8 +1255,8 @@ pagelayer_add_action('pagelayer_setup_history', function(){
1229
 
1230
  jQuery(pagelayer_editable).wrap('<div class="pagelayer-mega-menu-editor" >'+'</div>');
1231
 
1232
- pagelayer.$$('.pagelayer-settings-icon').attr("pagelayer-tag", "pl_mega_menu");
1233
- pagelayer.$$(".pagelayer-settings-icon").click();
1234
  pagelayer_mega_menu(jQuery('.pagelayer-mega-menu-editor'), pagelayer_post['ID']);
1235
  });
1236
 
371
  function pagelayer_render_end_pl_service(el){
372
  // Drag and Drop function for image
373
  if (typeof pagelayer_preDAndD_image !== "undefined") {
374
+ pagelayer_preDAndD_image(el.$);
375
  }
376
  }
377
 
707
  url: pagelayer_ajax_url+'action=pagelayer_fetch_featured_img',
708
  type: 'post',
709
  data: param,
710
+ dataType: 'json',
711
  success: function(data){
712
 
713
  var src = '';
714
+ var title = '';
715
+ var alt = '';
716
  if(pagelayer_empty(data)){
717
  src = el.tmp['img-'+el.atts['size']+'-url'] || el.tmp['img-url'];
718
  src = src || el.atts['img'];
719
  }else{
720
+ src = data['url'];
721
+ alt = data['alt'];
722
+ title = data['title'];
723
+ if(el.atts['size']+'-url' in data){
724
+ src = data[el.atts['size']+'-url'];
725
+ }
726
  }
727
 
728
  var img_html = '<img class="pagelayer-img" src="'+pagelayer.blank_img+'" />';
729
  if(src){
730
+ img_html = '<img class="pagelayer-img" src="' + src + '" title="' + title + '" alt="' + alt + '"/>';
731
  }
732
 
733
  el.$.find('.pagelayer-featured-img').html(img_html);
763
  function pagelayer_compare_object(obj1, obj2){
764
  var objectsAreSame = true;
765
  for(var propertyName in obj1){
766
+ if(obj1[propertyName] !== obj2[propertyName]){
767
+ objectsAreSame = false;
768
+ break;
769
+ }
770
  }
771
  for(var propertyName in obj2){
772
+ if(obj1[propertyName] !== obj2[propertyName]){
773
+ objectsAreSame = false;
774
+ break;
775
+ }
776
  }
777
  return objectsAreSame;
778
  }
1024
  }
1025
 
1026
  if(el.atts['field_type'] == 'select'){
1027
+ html += '<select name="'+el.atts['field_name']+'" '+required+'>'
1028
  if(!pagelayer_empty(el.atts['label_name']) && !pagelayer_empty(el.atts['label_as_holder'])){
1029
  html += '<option value="" disabled selected>'+el.atts['label_name']+'</option>';
1030
  }else{
1041
  }else if(el.atts['field_type'] == 'checkbox'){
1042
  if(!pagelayer_empty(el.atts['values'])){
1043
  options = el.atts['values'].split("\n");
1044
+ html += '<div class="pagelayer-radcheck-holder pagelayer-contact-checkbox" '+required+'>';
1045
  for(var x in options){
1046
+ html += '<div><input type="checkbox" id="'+el.id+options[x].trim()+'" name="'+el.atts['field_name']+'[]" '+
1047
+ 'value="'+options[x].trim()+'" /><label for="'+el.id+options[x].trim()+'" class="pagelayer-form-label">'+options[x].trim()+'</label></div>';
1048
  }
1049
  html += '</div>';
1050
  }
1125
  }else{
1126
  jEle.removeAttr('display_expired_text', exp);
1127
  }
1128
+
1129
+ pagelayer_countdown(jEle);
1130
+
1131
+ if(pagelayer_empty(el['atts']['days']) && pagelayer_empty(el['atts']['hours']) && pagelayer_empty(el['atts']['minutes']) && pagelayer_empty(el['atts']['seconds']) ){
1132
+ jEle.find('.pagelayer-countdown-counter').html('<h2>Countdown Timer Holder</h2>');
1133
+ }
1134
+
1135
  }
1136
 
1137
  // Render the share
1233
  pagelayer_anim_heading(jEle);
1234
  }
1235
 
1236
+ // Showing contact form message in the editor only.
1237
+ function pagelayer_render_end_pl_contact(el){
1238
+ if(el.atts['show_msg_box']){
1239
+ var msgBox = el.$.find('.pagelayer-message-box');
1240
+ if(el.$.find('.pagelayer-message-box').length==2){
1241
+ msgBox.eq(0).text('Demo success box');
1242
+ msgBox.eq(0).addClass('pagelayer-cf-msg-suc');
1243
+ msgBox.eq(1).text('Demo failed box');
1244
+ msgBox.eq(1).addClass('pagelayer-cf-msg-err');
1245
+ }
1246
+ }
1247
+ }
1248
+
1249
  // Mega Menu popup handler
1250
  pagelayer_add_action('pagelayer_setup_history', function(){
1251
 
1255
 
1256
  jQuery(pagelayer_editable).wrap('<div class="pagelayer-mega-menu-editor" >'+'</div>');
1257
 
1258
+ pagelayer.$$('.pagelayer-settings-icon, .pagelayer-settings').attr('pagelayer-tag', 'pl_mega_menu');
1259
+ pagelayer.$$('.pagelayer-settings-icon, .pagelayer-settings').click();
1260
  pagelayer_mega_menu(jQuery('.pagelayer-mega-menu-editor'), pagelayer_post['ID']);
1261
  });
1262
 
languages/en.json CHANGED
@@ -1349,7 +1349,7 @@
1349
  "use_recaptcha_desc" : "Protect this form from spam and abuse. Configure Google reCAPTCHA in plugin settings first.",
1350
  "form_id" : "Form ID",
1351
  "label_name" : "Label Name",
1352
- "form_id_desc" : "Is used in e-mail template",
1353
  "form_name" : "Form Name",
1354
  "form_name_desc" : "Is used in e-mail subject",
1355
  "input_field_type" : "Select Field Type",
@@ -1846,5 +1846,28 @@
1846
  "body_style" : "Body Style",
1847
  "item_alignment" : "Item Alignment",
1848
  "back_to_default" : "Restore Default",
1849
- "disable_category" : "Disable Category"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1850
  }
1349
  "use_recaptcha_desc" : "Protect this form from spam and abuse. Configure Google reCAPTCHA in plugin settings first.",
1350
  "form_id" : "Form ID",
1351
  "label_name" : "Label Name",
1352
+ "form_id_desc" : "Is used in e-mail template. This should be unique for every contact form in the page",
1353
  "form_name" : "Form Name",
1354
  "form_name_desc" : "Is used in e-mail subject",
1355
  "input_field_type" : "Select Field Type",
1846
  "body_style" : "Body Style",
1847
  "item_alignment" : "Item Alignment",
1848
  "back_to_default" : "Restore Default",
1849
+ "disable_category" : "Disable Category",
1850
+ "ele_custom_bg_size" : "Custom Size",
1851
+ "show_msg_box" : "Show Message Box",
1852
+ "failed" : "Failed",
1853
+ "add_new_tag" : "Add New Tag",
1854
+ "show_msg_box_desc" : "Toggle to show or hide the message boxes for both success and failed. This is only for designing the messages !",
1855
+ "note" : "Note",
1856
+ "note_color" : "Note Color",
1857
+ "write_an_excerpt" : "Write an excerpt (optional)",
1858
+ "discussion" : "Discussion",
1859
+ "allow_comments" : "Allow Comments",
1860
+ "allow_p_and_t" : "Allow Pingbacks & Trackbacks",
1861
+ "url_slug" : "URL Slug",
1862
+ "perma_desc" : "This is the URL of the <span class='pagelayer-post-type'>Post</span>",
1863
+ "status_visibility" : "Status & Visibility",
1864
+ "password_protected" : "Password Protected",
1865
+ "visibility" : "Visibility",
1866
+ "password" : "Password",
1867
+ "publish_date" : "Publish Date",
1868
+ "sticky_post" : "Stick to the top of the blog",
1869
+ "page_attributes" : "Page Attributes",
1870
+ "post_parent" : "Parent Page",
1871
+ "delete_post_conf" : "Are you sure you want to delete this ?",
1872
+ "empty_post_content" : "The content of the post is empty. Are you sure you want to save the post with blank content."
1873
  }
main/ajax.php CHANGED
@@ -111,6 +111,12 @@ function pagelayer_wp_widget_ajax(){
111
  }
112
  }
113
 
 
 
 
 
 
 
114
  // Get the form
115
  ob_start();
116
  $widget->form($instance);
@@ -176,7 +182,7 @@ function pagelayer_save_content(){
176
  }
177
 
178
  // Check if the post exists
179
- if(!empty($postID) && !empty($content)){
180
 
181
  $content = base64_decode($content);
182
 
@@ -187,9 +193,9 @@ function pagelayer_save_content(){
187
  $content = wp_slash($content);
188
 
189
  $post = array(
190
- 'ID' => $postID,
191
- 'post_content' => $content,
192
- );
193
 
194
  $is_xss = pagelayer_xss_content($content);
195
 
@@ -198,22 +204,83 @@ function pagelayer_save_content(){
198
  pagelayer_json_output($msg);
199
  }
200
 
201
- if(!empty($_REQUEST['post_status'])){
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
- $post['post_status'] = $_REQUEST['post_status'];
 
 
 
 
204
 
205
- if(!empty($post['post_status']) && $post['post_status'] == 'publish'){
206
-
207
- // Allowed to publish pages ?
208
- if($_post->post_type == 'page' && !current_user_can('publish_pages')){
209
- $msg['error'][] = __pl('no_publish_permission');
210
- pagelayer_json_output($msg);
211
- }
212
-
213
- // Allowed to publish posts ?
214
- if($_post->post_type == 'post' && !current_user_can('publish_posts')){
215
- $post['post_status'] = 'pending';
216
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  }
218
  }
219
 
@@ -240,6 +307,9 @@ function pagelayer_save_content(){
240
  $msg['error'] = __pl('post_update_err').' : '.implode('', $errors);
241
  }else{
242
 
 
 
 
243
  // Is this a Pagelayer post
244
  $data = get_post_meta($postID, 'pagelayer-data', true);
245
 
@@ -258,6 +328,8 @@ function pagelayer_save_content(){
258
  $msg['error'] = __pl('post_update_err');
259
  }
260
 
 
 
261
  // Save global widgets data
262
  if(!empty($_REQUEST['global_widgets'])){
263
  pagelayer_save_templ_content(true);
@@ -890,16 +962,20 @@ function pagelayer_post_info() {
890
  // Get the Featured Image
891
  add_action('wp_ajax_pagelayer_fetch_featured_img', 'pagelayer_fetch_featured_img');
892
  function pagelayer_fetch_featured_img(){
893
-
894
  // Some AJAX security
895
  check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
896
 
897
- if($_POST['size']){
898
- echo get_the_post_thumbnail_url((int)$_POST['post_id'], sanitize_text_field($_POST['size']));
899
- }else{
900
- echo get_the_post_thumbnail_url((int)$_POST['post_id']);
 
901
  }
902
- wp_die();
 
 
 
903
  }
904
 
905
  // Get the postfolio posts
@@ -1888,4 +1964,152 @@ function pagelayer_export_template(){
1888
  // Output and die
1889
  pagelayer_json_output($done);
1890
 
1891
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
  }
113
 
114
+ // Settings instance For Text widget
115
+ if($widget->id_base == 'text'){
116
+ $instance['visual'] = false;
117
+ $instance['legacy'] = false;
118
+ }
119
+
120
  // Get the form
121
  ob_start();
122
  $widget->form($instance);
182
  }
183
 
184
  // Check if the post exists
185
+ if(!empty($postID)){
186
 
187
  $content = base64_decode($content);
188
 
193
  $content = wp_slash($content);
194
 
195
  $post = array(
196
+ 'ID' => $postID,
197
+ 'post_content' => $content,
198
+ );
199
 
200
  $is_xss = pagelayer_xss_content($content);
201
 
204
  pagelayer_json_output($msg);
205
  }
206
 
207
+ // Any properties ?
208
+ $allowed = ['post_title', 'post_name', 'post_excerpt', 'post_status', 'post_password', 'post_date', 'post_author', 'post_parent', 'menu_order'];
209
+
210
+ foreach($allowed as $k){
211
+ if(isset($_REQUEST[$k])){
212
+ $post[$k] = $_REQUEST[$k];
213
+ }
214
+ }
215
+
216
+ $post['comment_status'] = !empty($_REQUEST['comment_status']) ? 'open' : 'closed';
217
+ $post['ping_status'] = !empty($_REQUEST['ping_status']) ? 'open' : 'closed';
218
+
219
+ if(!empty($post['post_status']) && $post['post_status'] == 'publish'){
220
 
221
+ // Allowed to publish pages ?
222
+ if($_post->post_type == 'page' && !current_user_can('publish_pages')){
223
+ $msg['error'][] = __pl('no_publish_permission');
224
+ pagelayer_json_output($msg);
225
+ }
226
 
227
+ // Allowed to publish posts ?
228
+ if($_post->post_type == 'post' && !current_user_can('publish_posts')){
229
+ $post['post_status'] = 'pending';
230
+ }
231
+ }
232
+
233
+ if(!empty($post['post_password'])){
234
+ $post['post_password'] = (in_array($post['post_status'], array('pass_protected', 'publish')) ? $post['post_password'] : '');
235
+ $post['post_status'] = 'publish';
236
+ }else{
237
+ $post['post_status'] = ($post['post_status'] == 'pass_protected') ? 'publish' : $post['post_status'];
238
+ $post['post_password'] = '';
239
+ }
240
+
241
+ // Set post GMT time
242
+ if(!empty($post['post_date']) && '0000-00-00 00:00:00' !== $post['post_date']){
243
+ $post['post_date_gmt'] = get_gmt_from_date( $post['post_date'] );
244
+
245
+ if( in_array($post['post_status'], array('future', 'publish')) && $_post->post_date_gmt === '0000-00-00 00:00:00' ){
246
+ $post['edit_date'] = true;
247
+ }
248
+ }
249
+
250
+ $_REQUEST['featured_image'] = (int) $_REQUEST['featured_image'];
251
+ if(!empty($_REQUEST['featured_image'])){
252
+ set_post_thumbnail($postID, $_REQUEST['featured_image']);
253
+ }else{
254
+ delete_post_thumbnail($postID);
255
+ }
256
+
257
+ if(isset($_REQUEST['post_category'])){
258
+ if($_post->post_type == 'post'){
259
+ $post['post_category'] = explode(',', sanitize_text_field($_REQUEST['post_category']));
260
+ }else{
261
+ $cat_name = pagelayer_post_type_category($_post->post_type);
262
+ if($cat_name){
263
+ $post['tax_input'][$cat_name] = explode(',', sanitize_text_field($_REQUEST['post_category']));
264
+ }
265
+ }
266
+ }
267
+
268
+ if(isset($_REQUEST['post_tags'])){
269
+ if($_post->post_type == 'post'){
270
+ $post['tags_input'] = explode(',', sanitize_text_field($_REQUEST['post_tags']));
271
+ }else{
272
+ $tag_name = pagelayer_post_type_tag($_post->post_type);
273
+ if($tag_name){
274
+ $post['tax_input'][$tag_name] = explode(',', sanitize_text_field($_REQUEST['post_tags']));
275
+ }
276
+ }
277
+ }
278
+
279
+ if(isset($_REQUEST['post_sticky']) && !empty($_REQUEST['post_sticky'])){
280
+ stick_post( $postID );
281
+ }else{
282
+ if(is_sticky($postID)){
283
+ unstick_post( $postID );
284
  }
285
  }
286
 
307
  $msg['error'] = __pl('post_update_err').' : '.implode('', $errors);
308
  }else{
309
 
310
+ // Get the updated post
311
+ $_post = get_post($postID);
312
+
313
  // Is this a Pagelayer post
314
  $data = get_post_meta($postID, 'pagelayer-data', true);
315
 
328
  $msg['error'] = __pl('post_update_err');
329
  }
330
 
331
+ $msg['post_status'] = (empty($_post->post_password)) ? $_post->post_status : 'pass_protected';
332
+
333
  // Save global widgets data
334
  if(!empty($_REQUEST['global_widgets'])){
335
  pagelayer_save_templ_content(true);
962
  // Get the Featured Image
963
  add_action('wp_ajax_pagelayer_fetch_featured_img', 'pagelayer_fetch_featured_img');
964
  function pagelayer_fetch_featured_img(){
965
+
966
  // Some AJAX security
967
  check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
968
 
969
+ $id = get_post_thumbnail_id( (int) $_POST['post_id'] );
970
+ $img = [];
971
+
972
+ if(empty($id)){
973
+ pagelayer_json_output($img);
974
  }
975
+
976
+ $img = pagelayer_image($id);
977
+ pagelayer_json_output($img);
978
+
979
  }
980
 
981
  // Get the postfolio posts
1964
  // Output and die
1965
  pagelayer_json_output($done);
1966
 
1967
+ }
1968
+
1969
+ add_action('wp_ajax_pagelayer_get_cat_checkboxes', 'pagelayer_get_cat_checkboxes');
1970
+ function pagelayer_get_cat_checkboxes(){
1971
+
1972
+ // Some AJAX security
1973
+ check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
1974
+
1975
+ $ret = [];
1976
+ $cat_name = '';
1977
+
1978
+ if(!current_user_can('manage_categories')){
1979
+ $ret['error'] = __pl('no_permission');
1980
+ pagelayer_json_output($ret);
1981
+ }
1982
+
1983
+ if(empty($_POST['postid']) || !is_numeric($_POST['postid'])){
1984
+ $ret['error'] = __pl('invalid_post_id');
1985
+ pagelayer_json_output($ret);
1986
+ }
1987
+
1988
+ $post = (int) $_POST['postid'];
1989
+ $post = get_post($post);
1990
+
1991
+ if(empty($post) || is_wp_error($post)){
1992
+ $ret['error'] = __pl('invalid_post_id');
1993
+ pagelayer_json_output($ret);
1994
+ }
1995
+
1996
+ $cat_name = pagelayer_post_type_category($post->post_type);
1997
+
1998
+ if(!empty($_POST['new_cat'])){
1999
+ parse_str($_POST['new_cat'], $formdata);
2000
+ $ret['new_cat_id'] = wp_insert_category([
2001
+ 'taxonomy' => $cat_name,
2002
+ 'cat_name' => $formdata['category_name'],
2003
+ 'category_parent' => (($formdata['pagelayer_cat_parent'] == 0) ? '' : $formdata['pagelayer_cat_parent'])
2004
+ ]);
2005
+ }
2006
+
2007
+ $ret += pagelayer_post_cats($post);
2008
+
2009
+ pagelayer_json_output($ret);
2010
+
2011
+ }
2012
+
2013
+ add_action('wp_ajax_pagelayer_get_post_tags', 'pagelayer_get_post_tags');
2014
+ function pagelayer_get_post_tags(){
2015
+
2016
+ // Some AJAX security
2017
+ check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
2018
+
2019
+ $ret = [];
2020
+ $tag_name = '';
2021
+
2022
+ if(!current_user_can('manage_categories')){
2023
+ $ret['error'] = __pl('no_permission');
2024
+ pagelayer_json_output($ret);
2025
+ }
2026
+
2027
+ if(empty($_POST['postid']) || !is_numeric($_POST['postid']) ){
2028
+ pagelayer_json_output($ret);
2029
+ }
2030
+
2031
+ $post = (int) $_POST['postid'];
2032
+ $post = get_post($post);
2033
+
2034
+ if(empty($post) || is_wp_error($post)){
2035
+ $ret['error'] = __pl('invalid_post_id');
2036
+ pagelayer_json_output($ret);
2037
+ }
2038
+
2039
+ $tag_name = pagelayer_post_type_category($post->post_type);
2040
+
2041
+ if(!empty($_POST['new_tag'])){
2042
+ $ret['tag_id'] = wp_insert_term($_POST['new_tag'], $tag_name);
2043
+ $ret['tag_id'] = $ret['tag_id']['term_id'];
2044
+ }
2045
+
2046
+ $ret += pagelayer_post_tags($post);
2047
+
2048
+ pagelayer_json_output($ret);
2049
+
2050
+ }
2051
+
2052
+ add_action('wp_ajax_pagelayer_custom_font', 'pagelayer_custom_font');
2053
+ function pagelayer_custom_font(){
2054
+
2055
+ // Some AJAX security
2056
+ check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
2057
+
2058
+ $ret = [];
2059
+
2060
+ if(empty($_POST['font_name'])){
2061
+ pagelayer_json_output($ret);
2062
+ }
2063
+
2064
+ $name = preg_replace('/_plf$/is', '', pagelayer_optREQ('font_name'));
2065
+ //echo $name;
2066
+
2067
+ $args = [
2068
+ 'post_type' => PAGELAYER_FONT_POST_TYPE,
2069
+ 'status' => 'publish',
2070
+ 'posts_per_page' => 1,
2071
+ 'name' => $name
2072
+ ];
2073
+
2074
+ //var_dump($pagelayer->fonts);
2075
+
2076
+ $query = get_posts($args);
2077
+ //var_dump($query);
2078
+
2079
+ if(empty($query)){
2080
+ pagelayer_json_output($ret);
2081
+ }
2082
+
2083
+ $post = $query[0];
2084
+ $meta_box_value = get_post_meta( $post->ID, 'pagelayer_font_link', true);
2085
+ if(empty($meta_box_value)){
2086
+ pagelayer_json_output($ret);
2087
+ }
2088
+
2089
+ $ret['style']= '<style id="'.$name.'_plf" >@font-face { font-family: "'.$name.'_plf"'.'; src: url("'.$meta_box_value.'"); font-weight: 100 200 300 400 500 600 700 800 900;}</style>';
2090
+
2091
+ pagelayer_json_output($ret);
2092
+
2093
+ }
2094
+
2095
+ add_action('wp_ajax_pagelayer_trash_post', 'pagelayer_trash_post');
2096
+ function pagelayer_trash_post(){
2097
+
2098
+ // Some AJAX security
2099
+ check_ajax_referer('pagelayer_ajax', 'pagelayer_nonce');
2100
+
2101
+ $ret = [];
2102
+
2103
+ if(empty($_POST['postid']) && !is_numeric($_POST['postid'])){
2104
+ $ret = ['error' => __pl('invalid_post_id')];
2105
+ pagelayer_json_output($ret);
2106
+ }
2107
+
2108
+ $ret['url'] = admin_url('/edit.php?post_type=') .get_post_type($_POST['postid']);
2109
+
2110
+ wp_trash_post($_POST['postid']);
2111
+
2112
+ pagelayer_json_output($ret);
2113
+
2114
+ }
2115
+
main/custom_fonts.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //////////////////////////////////////////////////////////////
4
+ //===========================================================
5
+ // custom_fonts.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
+ // This function will handle the custom fonts pages in PageLayer
28
+ add_action('init', 'pagelayer_custom_fonts_page', 9999);
29
+ function pagelayer_custom_fonts_page() {
30
+
31
+ global $pagelayer;
32
+
33
+ // Custom fonts supports
34
+ $supports = array(
35
+ 'title', // post title
36
+ );
37
+
38
+ // Add custom fonts lables
39
+ $labels = array(
40
+ 'name' => _x('Custom Fonts', 'plural'),
41
+ 'singular_name' => _x('Custom Font', 'singular'),
42
+ 'menu_name' => _x('Custom Fonts', 'admin menu'),
43
+ 'name_admin_bar' => _x('Custom Fonts', 'admin bar'),
44
+ 'add_new' => _x('Add New', 'Add'),
45
+ 'add_new_item' => __('Add New'),
46
+ 'new_item' => __('New Font'),
47
+ 'edit_item' => __('Edit Font'),
48
+ 'view_item' => __('View Font'),
49
+ 'all_items' => __('All Fonts'),
50
+ 'search_items' => __('Search Fonts'),
51
+ 'not_found' => __('No Pagelayer custom fonts found'),
52
+ );
53
+
54
+ $args = array(
55
+ 'supports' => $supports,
56
+ 'labels' => $labels,
57
+ 'public' => false,
58
+ 'show_in_menu' => false,
59
+ 'publicly_queryable' => true,
60
+ 'show_ui' => true,
61
+ 'exclude_from_search' => true,
62
+ 'show_in_nav_menus' => false,
63
+ 'has_archive' => false,
64
+ 'rewrite' => false,
65
+ );
66
+
67
+ // Register custom post type
68
+ register_post_type(PAGELAYER_FONT_POST_TYPE, $args);
69
+ remove_post_type_support( PAGELAYER_FONT_POST_TYPE, 'editor');
70
+ }
71
+
72
+ // Removing extra columns
73
+ add_filter( 'manage_'.PAGELAYER_FONT_POST_TYPE.'_posts_columns', 'pagelayer_add_custom_columns' );
74
+ function pagelayer_add_custom_columns($columns){
75
+
76
+ unset( $columns['author'] );
77
+ unset( $columns['date'] );
78
+
79
+ $columns['pl-preview'] = __('Preview');
80
+
81
+ return $columns;
82
+ }
83
+
84
+ // Adding preview column data
85
+ add_action( 'manage_'.PAGELAYER_FONT_POST_TYPE.'_posts_custom_column' , 'pagelayer_add_custom_columns_data', 10, 2 );
86
+ function pagelayer_add_custom_columns_data( $column, $post_id ){
87
+ if($column == __('pl-preview')){
88
+ $font_link = get_post_meta( $post_id, 'pagelayer_font_link', true );
89
+ echo '<style>@font-face { font-family: "'.get_the_title($post_id).'"; src: url("'.wp_unslash( $font_link ).'"); }</style>';
90
+ echo '<span style="font-family:\''.get_the_title($post_id).'\'; font-size:16px" >Preview of the CUSTOM font</span>';
91
+ }
92
+ }
93
+
94
+ // Removing row actions
95
+ add_filter( 'post_row_actions', 'pagelayer_remove_row_actions', 10, 1 );
96
+ function pagelayer_remove_row_actions( $actions ){
97
+ if( get_post_type() === PAGELAYER_FONT_POST_TYPE ){
98
+ foreach($actions as $action => $html){
99
+ if($action == 'edit' || $action == 'trash' || $action == 'clone' || $action == 'untrash' || $action == 'delete'){
100
+ continue;
101
+ }else{
102
+ unset($actions[$action]);
103
+ }
104
+ }
105
+ }
106
+ return $actions;
107
+ }
108
+
109
+ // Removing Screen options
110
+ add_filter('screen_options_show_screen', 'pagelayer_remove_screen_options');
111
+ function pagelayer_remove_screen_options() {
112
+ if(get_post_type() == PAGELAYER_FONT_POST_TYPE) {
113
+ return false;
114
+ }
115
+ return true;
116
+ }
117
+
118
+ // Removing all other metaboxes.
119
+ add_action('admin_init', function() {pagelayer_remove_all_metaboxes(PAGELAYER_FONT_POST_TYPE);});
120
+ function pagelayer_remove_all_metaboxes($type) {
121
+ add_filter("get_user_option_meta-box-order_{$type}", function() use($type) {
122
+ global $wp_meta_boxes;
123
+ $publishbox = $wp_meta_boxes[$type]['side']['core']['submitdiv'];
124
+ $fontsBox = $wp_meta_boxes[$type]['normal']['default']['pl-fonts-link-box'];
125
+ $wp_meta_boxes[$type] = array(
126
+ 'side' => array(
127
+ 'core' => array(
128
+ 'submitdiv' => $publishbox
129
+ )
130
+ ),
131
+ 'normal' => array(
132
+ 'default' => array(
133
+ 'pl-fonts-link-box' => $fontsBox
134
+ )
135
+ )
136
+ );
137
+ return array();
138
+ }, PHP_INT_MAX);
139
+ }
140
+
141
+ // Hiding extra options of publish metabox
142
+ add_action( 'admin_head', 'pagelayer_hide_publish_options' );
143
+ function pagelayer_hide_publish_options() {
144
+ if(get_post_type() == PAGELAYER_FONT_POST_TYPE){
145
+ echo '<style>.submitbox #minor-publishing{ display: none; }</style>';
146
+ }
147
+ }
148
+
149
+ // Adding source metabox
150
+ add_action('add_meta_boxes', 'pagelayer_add_meta_box');
151
+ function pagelayer_add_meta_box(){
152
+ add_meta_box( 'pl-fonts-link-box', _x('Source', 'font source'), 'pagelayer_font_link_metabox', PAGELAYER_FONT_POST_TYPE, 'normal', 'default', null);
153
+ }
154
+
155
+ function pagelayer_font_link_metabox($object){
156
+ wp_enqueue_media();
157
+ wp_nonce_field('pagelayer-font-post', 'pagelayer');
158
+ $link = get_post_meta($object->ID, 'pagelayer_font_link', true);
159
+ ?>
160
+ <div>
161
+ <table width="100%">
162
+ <tr>
163
+ <th valign="top" style="text-align:right; padding-right:20px; width:20%;"><?php echo __('Font File');?> : </th>
164
+ <td>
165
+ <div>
166
+ <input type="text" class="pagelayer_font_input" id="pl_font_link" name="pagelayer_font_link" onclick="fontUpload(event)" style="width:70%" value="<?php echo wp_unslash($link); ?>" autocomplete="false" readonly="true"/>
167
+ <button type="button" class="button button-light" onclick="fontUpload(event)">Upload Font</button>
168
+ </div>
169
+ </td>
170
+ </tr>
171
+ </table>
172
+ </div>
173
+ <script>
174
+
175
+ window.onload = function(){
176
+ jQuery('#submitdiv').on('click', '#publish', function(e){
177
+
178
+ if(jQuery('#title').val()==''){
179
+ alert('Please insert title of the page');
180
+ return false;
181
+ }else{
182
+ if(jQuery('#pl_font_link').val()==''){
183
+ alert('Please insert link of the font');
184
+ return false;
185
+ }else{
186
+ return true;
187
+ }
188
+ }
189
+
190
+ });
191
+ }
192
+
193
+ function fontUpload(e){
194
+ var allowed_mime_type = ['.ttf', '.woff', '.woff2'];
195
+ var allClear = false;
196
+ var custom_uploader = wp.media({
197
+ title: 'Upload Font',
198
+ library : {
199
+ type : 'font'
200
+ },
201
+ button: {
202
+ text: 'Select Font' // button label text
203
+ },
204
+ multiple: false
205
+ }).on('select', function() { // it also has "open" and "close" events
206
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
207
+ for(var i=0; i<allowed_mime_type.length; i++){
208
+ if(attachment['filename'].indexOf(allowed_mime_type[i]) != -1){
209
+ allClear=true;
210
+ break;
211
+ }
212
+ }
213
+ if(allClear){
214
+ jQuery('.pagelayer_font_input').val(attachment['url']);
215
+ }else{
216
+ alert('Kindly insert a correct font file. Allowed font file types are (ttf|woff|woff2)');
217
+ }
218
+ }).open();
219
+ }
220
+ </script>
221
+
222
+ <?php }
223
+
224
+ // Saving source metabox content
225
+ add_action('save_post', 'pagelayer_save_source_meta_box', 10, 3);
226
+ function pagelayer_save_source_meta_box($post_id, $post, $update){
227
+
228
+ if(PAGELAYER_FONT_POST_TYPE != $post->post_type){
229
+ return $post_id;
230
+ }
231
+
232
+ // DO an admin referrer check
233
+ if(!empty($_POST)){
234
+ check_admin_referer('pagelayer-font-post', 'pagelayer');
235
+ }else{
236
+ return $post_id;
237
+ }
238
+
239
+ $meta_box_link_value = '';
240
+
241
+ if(isset($_POST['pagelayer_font_link'])){
242
+ $meta_box_link_value = wp_unslash($_POST['pagelayer_font_link']);
243
+ }
244
+
245
+ update_post_meta($post_id, 'pagelayer_font_link', $meta_box_link_value );
246
+
247
+ }
248
+
249
+ // Adding custom mime type
250
+ add_filter('upload_mimes', 'pagelayer_custom_mime_types', 1, 1);
251
+ function pagelayer_custom_mime_types($mime_types = array()){
252
+ global $pagelayer;
253
+
254
+ forEach($pagelayer->allowed_mime_type as $key => $value){
255
+ $mime_types[$key]=$value;
256
+ }
257
+ return $mime_types;
258
+ }
259
+
260
+ // Adding custom mime type
261
+ add_filter( 'mime_types', 'pagelayer_mime_types' );
262
+ function pagelayer_mime_types($default_mimes){
263
+ global $pagelayer;
264
+
265
+ forEach($pagelayer->allowed_mime_type as $key => $value){
266
+ $default_mimes[$key]=$value;
267
+ }
268
+
269
+ return $default_mimes;
270
+ }
271
+
272
+ // Adding custom mime type
273
+ add_filter( 'wp_check_filetype_and_ext', 'pagelayer_check_filetype_and_ext', 10, 5 );
274
+ function pagelayer_check_filetype_and_ext( $types, $file, $filename, $mimes, $real_mime = false ){
275
+ global $pagelayer;
276
+
277
+ forEach($pagelayer->allowed_mime_type as $key => $value){
278
+ if ( false !== strpos( $filename, '.'.$key ) ) {
279
+ $types['ext'] = $key;
280
+ $types['type'] = $value;
281
+ }
282
+ }
283
+
284
+ return $types;
285
+ }
286
+
287
+ // Removing notification.
288
+ add_filter( 'post_updated_messages', 'pagelayer_delete_notification' );
289
+ function pagelayer_delete_notification( $messages ){
290
+ if(get_post_type() == PAGELAYER_FONT_POST_TYPE){
291
+ unset($messages['post'][1]);
292
+ unset($messages['post'][6]);
293
+ return $messages;
294
+ }
295
+ }
296
+
main/font-options.php CHANGED
@@ -26,8 +26,25 @@ if(!defined('PAGELAYER_VERSION')) {
26
 
27
  global $pagelayer, $pl_error;
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  // Fonts
30
- $pagelayer->fonts = ['', 'ABeeZee', 'Abel', 'Abhaya Libre', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya SC', 'Alegreya Sans', 'Alegreya Sans SC', 'Aleo', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allura', 'Almendra', 'Almendra Display', 'Almendra SC', 'Amarante', 'Amaranth', 'Amatic SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada', 'Andika', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo', 'Archivo Black', 'Archivo Narrow', 'Aref Ruqaa', 'Arima Madurai', 'Arimo', 'Arizonia', 'Armata', 'Arsenal', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asap Condensed', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'B612', 'B612 Mono', 'Bad Script', 'Bahiana', 'Bai Jamjuree', 'Baloo', 'Baloo Bhai', 'Baloo Bhaijaan', 'Baloo Bhaina', 'Baloo Chettan', 'Baloo Da', 'Baloo Paaji', 'Baloo Tamma', 'Baloo Tammudu', 'Baloo Thambi', 'Balthazar', 'Bangers', 'Barlow', 'Barlow Condensed', 'Barlow Semi Condensed', 'Barrio', 'Basic', 'Battambang', 'Baumans', 'Bayon', 'Belgrano', 'Bellefair', 'Belleza', 'Bellota', 'BenchNine', 'Bentham', 'Berkshire Swash', 'Bevan', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Biryani', 'Bitter', 'Black And White Picture', 'Black Han Sans', 'Black Ops One', 'Bokor', 'Bonbon', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Capriola', 'Cardo', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Chakra Petch', 'Changa', 'Changa One', 'Chango', 'Charm', 'Charmonman', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chivo', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Coming Soon', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cute Font', 'Cutive', 'Cutive Mono', 'Damion', 'Dancing Script', 'Dangrek', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Do Hyeon', 'Dokdo', 'Domine', 'Donegal One', 'Doppio One', 'Dorsa', 'Dosis', 'Dr Sugiyama', 'Duru Sans', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'East Sea Dokdo', 'Eater', 'Economica', 'Eczar', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Encode Sans', 'Encode Sans Condensed', 'Encode Sans Expanded', 'Encode Sans Semi Condensed', 'Encode Sans Semi Expanded', 'Engagement', 'Englebert', 'Enriqueta', 'Erica One', 'Esteban', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Fahkwang', 'Fanwood Text', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Faustina', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Finger Paint', 'Fira Mono', 'Fira Sans', 'Fira Sans Condensed', 'Fira Sans Extra Condensed', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Francois One', 'Frank Ruhl Libre', 'Freckle Face', 'Fredericka the Great', 'Fredoka One', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gaegu', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gamja Flower', 'Gentium Basic', 'Gentium Book Basic', 'Geo', 'Geostar', 'Geostar Fill', 'Germania One', 'Gidugu', 'Gilda Display', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Goblin One', 'Gochi Hand', 'Gorditas', 'Gothic A1', 'Goudy Bookletter 1911', 'Graduate', 'Grand Hotel', 'Gravitas One', 'Great Vibes', 'Griffy', 'Gruppo', 'Gudea', 'Gugi', 'Gurajada', 'Habibi', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Herr Von Muellerhoff', 'Hi Melody', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'IBM Plex Mono', 'IBM Plex Sans', 'IBM Plex Sans Condensed', 'IBM Plex Serif', 'IM Fell DW Pica', 'IM Fell DW Pica SC', 'IM Fell Double Pica', 'IM Fell Double Pica SC', 'IM Fell English', 'IM Fell English SC', 'IM Fell French Canon', 'IM Fell French Canon SC', 'IM Fell Great Primer', 'IM Fell Great Primer SC', 'Iceberg', 'Iceland', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Inika', 'Inknut Antiqua', 'Irish Grover', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'Jim Nightshade', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Josefin Sans', 'Josefin Slab', 'Joti One', 'Jua', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'Just Another Hand', 'Just Me Again Down Here', 'K2D', 'Kadwa', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kirang Haerang', 'Kite One', 'Knewave', 'KoHo', 'Kodchasan', 'Kosugi', 'Kosugi Maru', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Krub', 'Kumar One', 'Kumar One Outline', 'Kurale', 'La Belle Aurore', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Lateef', 'Lato', 'League Script', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Libre Barcode 128', 'Libre Barcode 128 Text', 'Libre Barcode 39', 'Libre Barcode 39 Extended', 'Libre Barcode 39 Extended Text', 'Libre Barcode 39 Text', 'Libre Baskerville', 'Libre Franklin', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Lora', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'M PLUS 1p', 'M PLUS Rounded 1c', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Major Mono Display', 'Mako', 'Mali', 'Mallanna', 'Mandali', 'Manuale', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Markazi Text', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Merienda', 'Merienda One', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Mina', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Modak', 'Modern Antiqua', 'Mogra', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta', 'Mukta Mahee', 'Mukta Malar', 'Mukta Vaani', 'Muli', 'Mystery Quest', 'NTR', 'Nanum Brush Script', 'Nanum Gothic', 'Nanum Gothic Coding', 'Nanum Myeongjo', 'Nanum Pen Script', 'Neucha', 'Neuton', 'New Rocker', 'News Cycle', 'Niconne', 'Niramit', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Notable', 'Nothing You Could Do', 'Noticia Text', 'Noto Sans', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans TC', 'Noto Serif', 'Noto Serif JP', 'Noto Serif KR', 'Noto Serif SC', 'Noto Serif TC', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Nunito Sans', 'Odor Mean Chey', 'Offside', 'Old Standard TT', 'Oldenburg', 'Oleo Script', 'Oleo Script Swash Caps', 'Open Sans', 'Open Sans Condensed', 'Oranienbaum', 'Orbitron', 'Oregano', 'Orienta', 'Original Surfer', 'Oswald', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Overpass', 'Overpass Mono', 'Ovo', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Padauk', 'Palanquin', 'Palanquin Dark', 'Pangolin', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Podkova', 'Poiret One', 'Poller One', 'Poly', 'Pompiere', 'Pontano Sans', 'Poor Story', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Pragati Narrow', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Puritan', 'Purple Purse', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Racing Sans One', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Redressed', 'Reem Kufi', 'Reenie Beanie', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Roboto', 'Roboto Condensed', 'Roboto Mono', 'Roboto Slab', 'Rochester', 'Rock Salt', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rozha One', 'Rubik', 'Rubik Mono One', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'Sacramento', 'Sahitya', 'Sail', 'Saira', 'Saira Condensed', 'Saira Extra Condensed', 'Saira Semi Condensed', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita', 'Sarabun', 'Sarala', 'Sarina', 'Sarpanch', 'Satisfy', 'Sawarabi Gothic', 'Sawarabi Mincho', 'Scada', 'Scheherazade', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sedgwick Ave', 'Sedgwick Ave Display', 'Sen', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Simonetta', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Song Myung', 'Sonsie One', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans Pro', 'Source Serif Pro', 'Space Mono', 'Special Elite', 'Spectral', 'Spectral SC', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Squada One', 'Sree Krushnadevaraya', 'Sriracha', 'Srisakdi', 'Staatliches', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Stylish', 'Sue Ellen Francisco', 'Suez One', 'Sumana', 'Sunflower', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Tajawal', 'Tangerine', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'Thasadith', 'The Girl Next Door', 'Tienne', 'Tillana', 'Timmana', 'Tinos', 'Titan One', 'Titillium Web', 'Trade Winds', 'Trirong', 'Trocchi', 'Trochut', 'Trykker', 'Tulpen One', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Ultra', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'VT323', 'Vampiro One', 'Varela', 'Varela Round', 'Vast Shadow', 'Vesper Libre', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Vollkorn SC', 'Voltaire', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Wellfleet', 'Wendy One', 'Wire One', 'Work Sans', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeon Sung', 'Yeseva One', 'Yesteryear', 'Yrsa', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou', 'ZCOOL XiaoWei', 'Zeyada', 'Zilla Slab', 'Zilla Slab Highlight'];
31
 
32
  $pagelayer->font_style = ['' => 'Default',
33
  'normal' => 'Normal',
26
 
27
  global $pagelayer, $pl_error;
28
 
29
+ $pagelayer->fonts['default'] = [''];
30
+
31
+ $query = get_posts([
32
+ 'post_type' => PAGELAYER_FONT_POST_TYPE,
33
+ 'status' => 'publish',
34
+ 'posts_per_page' => -1 // For get all posts
35
+ ]);
36
+
37
+ if(!empty($query)){
38
+ $pagelayer->fonts['custom'] = array();
39
+ foreach($query as $key){
40
+ if(!empty($key->post_title)){
41
+ $pagelayer->fonts['custom'][$key->post_name.'_plf'] = $key->post_title;
42
+ }
43
+ }
44
+ }
45
+
46
  // Fonts
47
+ $pagelayer->fonts['google'] = ['ABeeZee', 'Abel', 'Abhaya Libre', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya SC', 'Alegreya Sans', 'Alegreya Sans SC', 'Aleo', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allura', 'Almendra', 'Almendra Display', 'Almendra SC', 'Amarante', 'Amaranth', 'Amatic SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada', 'Andika', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo', 'Archivo Black', 'Archivo Narrow', 'Aref Ruqaa', 'Arima Madurai', 'Arimo', 'Arizonia', 'Armata', 'Arsenal', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asap Condensed', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'B612', 'B612 Mono', 'Bad Script', 'Bahiana', 'Bai Jamjuree', 'Baloo', 'Baloo Bhai', 'Baloo Bhaijaan', 'Baloo Bhaina', 'Baloo Chettan', 'Baloo Da', 'Baloo Paaji', 'Baloo Tamma', 'Baloo Tammudu', 'Baloo Thambi', 'Balthazar', 'Bangers', 'Barlow', 'Barlow Condensed', 'Barlow Semi Condensed', 'Barrio', 'Basic', 'Battambang', 'Baumans', 'Bayon', 'Belgrano', 'Bellefair', 'Belleza', 'Bellota', 'BenchNine', 'Bentham', 'Berkshire Swash', 'Bevan', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Biryani', 'Bitter', 'Black And White Picture', 'Black Han Sans', 'Black Ops One', 'Bokor', 'Bonbon', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Capriola', 'Cardo', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Chakra Petch', 'Changa', 'Changa One', 'Chango', 'Charm', 'Charmonman', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chivo', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Coming Soon', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cute Font', 'Cutive', 'Cutive Mono', 'Damion', 'Dancing Script', 'Dangrek', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Do Hyeon', 'Dokdo', 'Domine', 'Donegal One', 'Doppio One', 'Dorsa', 'Dosis', 'Dr Sugiyama', 'Duru Sans', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'East Sea Dokdo', 'Eater', 'Economica', 'Eczar', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Encode Sans', 'Encode Sans Condensed', 'Encode Sans Expanded', 'Encode Sans Semi Condensed', 'Encode Sans Semi Expanded', 'Engagement', 'Englebert', 'Enriqueta', 'Erica One', 'Esteban', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Fahkwang', 'Fanwood Text', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Faustina', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Finger Paint', 'Fira Mono', 'Fira Sans', 'Fira Sans Condensed', 'Fira Sans Extra Condensed', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Francois One', 'Frank Ruhl Libre', 'Freckle Face', 'Fredericka the Great', 'Fredoka One', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gaegu', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gamja Flower', 'Gentium Basic', 'Gentium Book Basic', 'Geo', 'Geostar', 'Geostar Fill', 'Germania One', 'Gidugu', 'Gilda Display', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Goblin One', 'Gochi Hand', 'Gorditas', 'Gothic A1', 'Goudy Bookletter 1911', 'Graduate', 'Grand Hotel', 'Gravitas One', 'Great Vibes', 'Griffy', 'Gruppo', 'Gudea', 'Gugi', 'Gurajada', 'Habibi', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Herr Von Muellerhoff', 'Hi Melody', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'IBM Plex Mono', 'IBM Plex Sans', 'IBM Plex Sans Condensed', 'IBM Plex Serif', 'IM Fell DW Pica', 'IM Fell DW Pica SC', 'IM Fell Double Pica', 'IM Fell Double Pica SC', 'IM Fell English', 'IM Fell English SC', 'IM Fell French Canon', 'IM Fell French Canon SC', 'IM Fell Great Primer', 'IM Fell Great Primer SC', 'Iceberg', 'Iceland', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Inika', 'Inknut Antiqua', 'Irish Grover', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'Jim Nightshade', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Josefin Sans', 'Josefin Slab', 'Joti One', 'Jua', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'Just Another Hand', 'Just Me Again Down Here', 'K2D', 'Kadwa', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kirang Haerang', 'Kite One', 'Knewave', 'KoHo', 'Kodchasan', 'Kosugi', 'Kosugi Maru', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Krub', 'Kumar One', 'Kumar One Outline', 'Kurale', 'La Belle Aurore', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Lateef', 'Lato', 'League Script', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Libre Barcode 128', 'Libre Barcode 128 Text', 'Libre Barcode 39', 'Libre Barcode 39 Extended', 'Libre Barcode 39 Extended Text', 'Libre Barcode 39 Text', 'Libre Baskerville', 'Libre Franklin', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Lora', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'M PLUS 1p', 'M PLUS Rounded 1c', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Major Mono Display', 'Mako', 'Mali', 'Mallanna', 'Mandali', 'Manuale', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Markazi Text', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Merienda', 'Merienda One', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Mina', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Modak', 'Modern Antiqua', 'Mogra', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta', 'Mukta Mahee', 'Mukta Malar', 'Mukta Vaani', 'Muli', 'Mystery Quest', 'NTR', 'Nanum Brush Script', 'Nanum Gothic', 'Nanum Gothic Coding', 'Nanum Myeongjo', 'Nanum Pen Script', 'Neucha', 'Neuton', 'New Rocker', 'News Cycle', 'Niconne', 'Niramit', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Notable', 'Nothing You Could Do', 'Noticia Text', 'Noto Sans', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans TC', 'Noto Serif', 'Noto Serif JP', 'Noto Serif KR', 'Noto Serif SC', 'Noto Serif TC', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Nunito Sans', 'Odor Mean Chey', 'Offside', 'Old Standard TT', 'Oldenburg', 'Oleo Script', 'Oleo Script Swash Caps', 'Open Sans', 'Open Sans Condensed', 'Oranienbaum', 'Orbitron', 'Oregano', 'Orienta', 'Original Surfer', 'Oswald', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Overpass', 'Overpass Mono', 'Ovo', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Padauk', 'Palanquin', 'Palanquin Dark', 'Pangolin', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Podkova', 'Poiret One', 'Poller One', 'Poly', 'Pompiere', 'Pontano Sans', 'Poor Story', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Pragati Narrow', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Puritan', 'Purple Purse', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Racing Sans One', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Redressed', 'Reem Kufi', 'Reenie Beanie', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Roboto', 'Roboto Condensed', 'Roboto Mono', 'Roboto Slab', 'Rochester', 'Rock Salt', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rozha One', 'Rubik', 'Rubik Mono One', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'Sacramento', 'Sahitya', 'Sail', 'Saira', 'Saira Condensed', 'Saira Extra Condensed', 'Saira Semi Condensed', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita', 'Sarabun', 'Sarala', 'Sarina', 'Sarpanch', 'Satisfy', 'Sawarabi Gothic', 'Sawarabi Mincho', 'Scada', 'Scheherazade', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sedgwick Ave', 'Sedgwick Ave Display', 'Sen', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Simonetta', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Song Myung', 'Sonsie One', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans Pro', 'Source Serif Pro', 'Space Mono', 'Special Elite', 'Spectral', 'Spectral SC', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Squada One', 'Sree Krushnadevaraya', 'Sriracha', 'Srisakdi', 'Staatliches', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Stylish', 'Sue Ellen Francisco', 'Suez One', 'Sumana', 'Sunflower', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Tajawal', 'Tangerine', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'Thasadith', 'The Girl Next Door', 'Tienne', 'Tillana', 'Timmana', 'Tinos', 'Titan One', 'Titillium Web', 'Trade Winds', 'Trirong', 'Trocchi', 'Trochut', 'Trykker', 'Tulpen One', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Ultra', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'VT323', 'Vampiro One', 'Varela', 'Varela Round', 'Vast Shadow', 'Vesper Libre', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Vollkorn SC', 'Voltaire', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Wellfleet', 'Wendy One', 'Wire One', 'Work Sans', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeon Sung', 'Yeseva One', 'Yesteryear', 'Yrsa', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou', 'ZCOOL XiaoWei', 'Zeyada', 'Zilla Slab', 'Zilla Slab Highlight'];
48
 
49
  $pagelayer->font_style = ['' => 'Default',
50
  'normal' => 'Normal',
main/functions.php CHANGED
@@ -380,6 +380,10 @@ function pagelayer_supported_type($type){
380
  if(in_array($type, $pagelayer->settings['post_types'])){
381
  return true;
382
  }
 
 
 
 
383
 
384
  return false;
385
 
@@ -503,7 +507,7 @@ function pagelayer_user_can_edit($post = NULL){
503
  }
504
 
505
  // Is pagelayer supposed to edit this ?
506
- if(!in_array($post->post_type, $pagelayer->settings['post_types']) && $post->post_type != 'pagelayer-template'){
507
  return false;
508
  }
509
 
@@ -785,9 +789,11 @@ function pagelayer_add_shortcode($tag, $params = array()){
785
 
786
  foreach($props as $prop => $param){
787
 
788
- if(isset($param['export-def']) && isset($param['default']) && $param['export-def'] == 1)
789
  // Set default values to export for JS
790
- $pagelayer->default_params[$tag][$prop] = $param['default'];
 
 
 
791
  }
792
  }
793
  }
@@ -2874,4 +2880,160 @@ function pagelayer_create_blank_image($width, $height){
2874
 
2875
  return ob_get_clean();
2876
 
2877
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  if(in_array($type, $pagelayer->settings['post_types'])){
381
  return true;
382
  }
383
+
384
+ if($type == $pagelayer->builder['name']){
385
+ return true;
386
+ }
387
 
388
  return false;
389
 
507
  }
508
 
509
  // Is pagelayer supposed to edit this ?
510
+ if(!pagelayer_supported_type($post->post_type)){
511
  return false;
512
  }
513
 
789
 
790
  foreach($props as $prop => $param){
791
 
 
792
  // Set default values to export for JS
793
+ if(isset($param['export-def']) && isset($param['default']) && $param['export-def'] == 1){
794
+ $pagelayer->default_params[$tag][$prop] = $param['default'];
795
+ }
796
+
797
  }
798
  }
799
  }
2880
 
2881
  return ob_get_clean();
2882
 
2883
+ }
2884
+
2885
+ // Get category name by post type
2886
+ function pagelayer_post_type_category($post_type){
2887
+
2888
+ $taxonomies = get_object_taxonomies( $post_type, 'objects');
2889
+
2890
+ foreach( $taxonomies as $key => $tax){
2891
+ if(!empty($tax->hierarchical)){
2892
+ return $key;
2893
+ }
2894
+ }
2895
+
2896
+ return false;
2897
+
2898
+ }
2899
+
2900
+ // Get tag name by post type
2901
+ function pagelayer_post_type_tag($post_type){
2902
+
2903
+ $taxonomies = get_object_taxonomies( $post_type, 'objects');
2904
+
2905
+ foreach( $taxonomies as $key => $tax){
2906
+ if(!empty($tax->show_tagcloud) && empty($tax->hierarchical)){
2907
+ return $key;
2908
+ }
2909
+ }
2910
+ return false;
2911
+
2912
+ }
2913
+
2914
+ // Get checkboxes of post categories.
2915
+ function pagelayer_post_cats($post, &$cat_name = ''){
2916
+
2917
+ $ret = [];
2918
+
2919
+ $cat_name = pagelayer_post_type_category($post->post_type);
2920
+
2921
+ if(empty($cat_name)){
2922
+ return $ret;
2923
+ }
2924
+
2925
+ include_once(ABSPATH.PAGELAYER_CMS_DIR_PREFIX.'-admin/includes/template.php');
2926
+
2927
+ $args1 = array(
2928
+ 'taxonomy' => $cat_name,
2929
+ 'checked_ontop' => false,
2930
+ 'echo' => false,
2931
+ );
2932
+
2933
+ $ret['with_checkbox'] = '<ul class="pagelayer-post-category" >'.wp_terms_checklist($post->ID, $args1 ).'</ul>';
2934
+
2935
+ $args2 = array(
2936
+ 'taxonomy' => $cat_name,
2937
+ 'hierarchical' => true,
2938
+ 'echo' => 0,
2939
+ 'class' => 'pagelayer-add-cat',
2940
+ 'name' => 'pagelayer_cat_parent',
2941
+ 'style' => 'list',
2942
+ 'hide_empty' => 0,
2943
+ );
2944
+
2945
+ $ret['without_checkbox'] = wp_dropdown_categories( $args2 );
2946
+
2947
+ return $ret;
2948
+
2949
+ }
2950
+
2951
+ // Get checkboxes of post tags.
2952
+ function pagelayer_post_tags($post, &$tag_name = ''){
2953
+
2954
+ $ret = [];
2955
+
2956
+ $tag_name = pagelayer_post_type_tag($post->post_type);
2957
+
2958
+ if(empty($tag_name)){
2959
+ return $ret;
2960
+ }
2961
+
2962
+ $ret['postTags'] = wp_get_post_terms( $post->ID, $tag_name );
2963
+
2964
+ $ret['allTags'] = get_tags(array( 'hide_empty' => false, 'taxonomy' => $tag_name ));
2965
+
2966
+ return $ret;
2967
+
2968
+ }
2969
+
2970
+ // Get users who can edit a particular post type
2971
+ function pagelayer_post_authors_by_type($post_type){
2972
+
2973
+ global $wp_post_types;
2974
+
2975
+ if(empty($wp_post_types[$post_type])){
2976
+ $users = get_users( array( 'role__in' => array( 'administrator' ) ) );
2977
+ }else{
2978
+ $req_role = $wp_post_types[$post_type]->cap->edit_posts;
2979
+ $roles__in = [];
2980
+ foreach( wp_roles()->roles as $role_slug => $role ){
2981
+ if( ! empty( $role['capabilities'][$req_role] ) )
2982
+ $roles__in[] = $role_slug;
2983
+ }
2984
+ $users = get_users( array( 'role__in' => $roles__in ) );
2985
+ }
2986
+
2987
+ $user_array = [];
2988
+
2989
+ foreach ( $users as $user ) {
2990
+ $user_array[$user->ID] = $user->display_name;
2991
+ }
2992
+
2993
+ return $user_array;
2994
+ }
2995
+
2996
+ function pagelayer_parent_post_prop($post){
2997
+ global $wp_post_types;
2998
+
2999
+ if(!empty($wp_post_types[$post->post_type]->hierarchical)){
3000
+ return pagelayer_list_parents(0, 0, $post, []);
3001
+ }else{
3002
+ return [];
3003
+ }
3004
+ }
3005
+
3006
+ function pagelayer_list_parents( $parent = 0, $level = 0, $post = null, $values=array('')){
3007
+
3008
+ global $wpdb;
3009
+
3010
+ $post = get_post( $post );
3011
+
3012
+ $items = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_parent, post_title FROM $wpdb->posts
3013
+ WHERE post_parent = %d
3014
+ AND post_type = '".$post->post_type."'
3015
+ AND post_status = 'publish'
3016
+ ORDER BY menu_order", $parent ) );
3017
+
3018
+ if ( !empty($items) ) {
3019
+ foreach ( $items as $item ) {
3020
+
3021
+ // A page cannot be its own parent.
3022
+ if ( $post && $post->ID && (int) $item->ID === $post->ID ) {
3023
+ continue;
3024
+ }
3025
+
3026
+ $pad = str_repeat( '-', $level );
3027
+
3028
+ if(count($values)==0){
3029
+ $values[] = '';
3030
+ }
3031
+
3032
+ $values[' '.$item->ID] = $pad.esc_html( $item->post_title );
3033
+
3034
+ $values = pagelayer_list_parents($item->ID, $level + 1, $post, $values );
3035
+ }
3036
+ }
3037
+
3038
+ return $values;
3039
+ }
main/import.php CHANGED
@@ -199,6 +199,14 @@ font-weight: 600;
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>
 
 
 
 
 
 
 
 
202
  </form>
203
  </div>
204
 
@@ -283,8 +291,8 @@ jQuery(document).ready(function(){
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
 
@@ -514,7 +522,7 @@ global $pagelayer, $pl_error, $sitepad;
514
 
515
 
516
  $_media = list_files($pagelayer_theme_path.'/images', 1);
517
- //r_print($_media);die();
518
 
519
  // Download images
520
  if(!empty($_REQUEST['download_imgs']) && file_exists($pagelayer_theme_path.'/images.json')){
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>
202
+ <div class="pagelayer-image-copyright">
203
+ <h2 class="pagelayer-sub-head">Image Copyright</h2>
204
+ <p>We try our best to use images that are free from legal perspectives. However, we do not take any responsibility for the same. Do you want to use the demo images with this theme ?</p>
205
+ <ul class="pagelayer-content">
206
+ <li><input type="checkbox" name="download_imgs" value="1"/> If you click here, then the images will be downloaded from their respective sources.<br/></li>
207
+ <li>By default it will use placeholder images which are distributed with this theme and can be replaced easily.</li>
208
+ </ul>
209
+ </div>
210
  </form>
211
  </div>
212
 
291
  </div>
292
  </div>
293
  <div style="width: 45%; display: inline-block; padding: 0px 10px; vertical-align: top;">';
294
+ $pages = (array) @$pagelayer_pages['page'];
295
+ foreach( $pages as $k => $v){
296
 
297
  $screenshot = $pagelayer_theme_url.'/screenshots/'.$k.'.jpg';
298
 
522
 
523
 
524
  $_media = list_files($pagelayer_theme_path.'/images', 1);
525
+ //pagelayer_print($_media);die();
526
 
527
  // Download images
528
  if(!empty($_REQUEST['download_imgs']) && file_exists($pagelayer_theme_path.'/images.json')){
main/live-body.php CHANGED
@@ -42,6 +42,12 @@ global $post, $pagelayer;
42
  $css_url = PAGELAYER_CSS.'/givecss.php?';
43
  }
44
 
 
 
 
 
 
 
45
  echo '
46
  <html>
47
  <head>
@@ -69,7 +75,7 @@ text-decoration:none;
69
  </style>
70
  </head>
71
 
72
- <body class="pagelayer-normalize pagelayer-body">
73
  <div class="pagelayer-errorBox">
74
  <div class="pagelayer-errorBox-close"><i class="fas fa-times"></i></div>
75
  <div class="pagelayer-errorBox-main">
@@ -119,7 +125,7 @@ text-decoration:none;
119
  </div>
120
  <div class="pagelayer-logo">
121
  <span class="pagelayer-options-icon pli pli-menu" style="display:none"></span>
122
- <img src="'.$pagelayer->LOGO.'" width="32" /><span class="pagelayer-logo-text pagelayer-topbar-mover">'.$pagelayer->BRAND_TEXT.'</span>
123
  <span class="pagelayer-settings-icon pli pli-service" aria-hidden="true"></span>
124
  </div>
125
  </td>
@@ -176,6 +182,10 @@ function loader(ran) {
176
  }
177
  loader(90);
178
 
 
 
 
 
179
  // Load the window if necessary i.e. an error in the JS of the iframe
180
  function onIframeLoad(){
181
  setTimeout(function(){
42
  $css_url = PAGELAYER_CSS.'/givecss.php?';
43
  }
44
 
45
+ $dark_mode = get_option('pagelayer_enable_dark_mode');
46
+ $dark_mode_class = '';
47
+ if(!empty($dark_mode)){
48
+ $dark_mode_class = 'pagelayer-dark';
49
+ };
50
+
51
  echo '
52
  <html>
53
  <head>
75
  </style>
76
  </head>
77
 
78
+ <body class="pagelayer-normalize pagelayer-body '.$dark_mode_class.'">
79
  <div class="pagelayer-errorBox">
80
  <div class="pagelayer-errorBox-close"><i class="fas fa-times"></i></div>
81
  <div class="pagelayer-errorBox-main">
125
  </div>
126
  <div class="pagelayer-logo">
127
  <span class="pagelayer-options-icon pli pli-menu" style="display:none"></span>
128
+ <img src="'.$pagelayer->LOGO.'" width="32" /><span class="pagelayer-logo-text pagelayer-topbar-mover">'.$pagelayer->BRAND_TEXT.(defined('PAGELAYER_PREMIUM') && strtolower($pagelayer->BRAND_TEXT) == 'pagelayer' ? '<sup style="margin: 3px; font-size: 12px; letter-spacing: 1px; font-family: "Roboto";">Pro</sup>' : '').'</span>
129
  <span class="pagelayer-settings-icon pli pli-service" aria-hidden="true"></span>
130
  </div>
131
  </td>
182
  }
183
  loader(90);
184
 
185
+ function $p(sel){
186
+ return pagelayer_iframe_cw.pagelayer.$$(sel);
187
+ }
188
+
189
  // Load the window if necessary i.e. an error in the JS of the iframe
190
  function onIframeLoad(){
191
  setTimeout(function(){
main/live.php CHANGED
@@ -96,7 +96,7 @@ class PageLayer_LiveEditor{
96
  // Header function to add certain things
97
  function wp_head(){
98
 
99
- global $pagelayer, $post, $wp_query;
100
 
101
  // Export the post props
102
  $_post = clone $post;
@@ -115,6 +115,8 @@ class PageLayer_LiveEditor{
115
 
116
  $pro_url = defined('POPULARFX_PRO_URL') ? POPULARFX_PRO_URL : PAGELAYER_PRO_URL;
117
  $pro_txt = defined('POPULARFX_PRO_URL') ? 'PopularFX Pro' : 'Pagelayer Pro';
 
 
118
 
119
  echo '
120
  <script type="text/javascript">
@@ -132,6 +134,7 @@ pagelayer_internal_linking_nonce = "'.wp_create_nonce('internal-linking').'";
132
  pagelayer_preview_nonce = "'. wp_create_nonce( 'post_preview_' . $post->ID ).'";
133
  pagelayer_url = "'.PAGELAYER_URL.'";
134
  pagelayer_postID = "'.$post->ID.'";
 
135
  pagelayer_post_permalink = "'.get_permalink($post->ID).'";
136
  pagelayer_tabs = '.json_encode($pagelayer->tabs).';
137
  pagelayer_isDirty = false;
@@ -143,13 +146,20 @@ pagelayer_site_logo = '.json_encode(pagelayer_site_logo()).';
143
  pagelayer_support_FI = "'. ( current_theme_supports('post-thumbnails') ) .'";
144
  pagelayer_editable = ".'.(!empty($pagelayer->template_editor) ? $pagelayer->template_editor : 'pagelayer-editable-area').'";
145
  pagelayer_recaptch_site_key = "'.(!empty($pagelayer_recaptch_site_key) ? $pagelayer_recaptch_site_key : '').'";
146
- pagelayer_post = '. @json_encode($_post) .';
147
  pagelayer_loaded_icons = '.json_encode(pagelayer_enabled_icons()).';
148
  pagelayer_social_urls = '.json_encode(pagelayer_get_social_urls()).';
149
  pagelayer_global_widgets = '.json_encode($pagelayer->global_widgets).';
150
  pagelayer_saved_sections = '.json_encode($pagelayer->saved_sections).';
151
  pagelayer_global_sections = '.json_encode($pagelayer->global_sections).';
152
- pagelayer_brand = "'.addslashes($pagelayer->BRAND_TEXT).'";';
 
 
 
 
 
 
 
153
 
154
  // Detect JS via givejs for better performance
155
  if(empty($pagelayer->settings['enable_giver'])){
@@ -230,6 +240,7 @@ filter:blur(2px);
230
 
231
  if(!empty($pagelayer->data_attr)){
232
  echo '<script>
 
233
  pagelayer.el = '.json_encode($pagelayer->data_attr).';
234
  </script>';
235
  }
96
  // Header function to add certain things
97
  function wp_head(){
98
 
99
+ global $pagelayer, $post, $wp_query, $_wp_post_type_features;
100
 
101
  // Export the post props
102
  $_post = clone $post;
115
 
116
  $pro_url = defined('POPULARFX_PRO_URL') ? POPULARFX_PRO_URL : PAGELAYER_PRO_URL;
117
  $pro_txt = defined('POPULARFX_PRO_URL') ? 'PopularFX Pro' : 'Pagelayer Pro';
118
+ $post_type = get_post_type_object($post->post_type);
119
+ $post_type_name = (!empty($post_type->labels->singular_name)) ? $post_type->labels->singular_name : ucfirst($post_type->name);
120
 
121
  echo '
122
  <script type="text/javascript">
134
  pagelayer_preview_nonce = "'. wp_create_nonce( 'post_preview_' . $post->ID ).'";
135
  pagelayer_url = "'.PAGELAYER_URL.'";
136
  pagelayer_postID = "'.$post->ID.'";
137
+ pagelayer_permalink_structure = "'.(empty(get_option('permalink_structure')) ? 0 : 1).'";
138
  pagelayer_post_permalink = "'.get_permalink($post->ID).'";
139
  pagelayer_tabs = '.json_encode($pagelayer->tabs).';
140
  pagelayer_isDirty = false;
146
  pagelayer_support_FI = "'. ( current_theme_supports('post-thumbnails') ) .'";
147
  pagelayer_editable = ".'.(!empty($pagelayer->template_editor) ? $pagelayer->template_editor : 'pagelayer-editable-area').'";
148
  pagelayer_recaptch_site_key = "'.(!empty($pagelayer_recaptch_site_key) ? $pagelayer_recaptch_site_key : '').'";
149
+ pagelayer_post = '. @json_encode($_post) .';
150
  pagelayer_loaded_icons = '.json_encode(pagelayer_enabled_icons()).';
151
  pagelayer_social_urls = '.json_encode(pagelayer_get_social_urls()).';
152
  pagelayer_global_widgets = '.json_encode($pagelayer->global_widgets).';
153
  pagelayer_saved_sections = '.json_encode($pagelayer->saved_sections).';
154
  pagelayer_global_sections = '.json_encode($pagelayer->global_sections).';
155
+ pagelayer_brand = "'.addslashes($pagelayer->BRAND_TEXT).'";
156
+ pagelayer_post_type_features = '.json_encode(@$_wp_post_type_features[$post->post_type]).';
157
+ pagelayer_post_categories = '.json_encode(pagelayer_post_cats($post)).';
158
+ pagelayer_post_tags = '.json_encode(pagelayer_post_tags($post)).';
159
+ pagelayer_shortcodes.pl_post_props.name = "'.ucfirst($post_type_name).' '. __pl('Settings').'";
160
+ pagelayer_shortcodes.pl_post_props.params.post_author.list = '.json_encode(pagelayer_post_authors_by_type($post->post_type)).';
161
+ pagelayer_shortcodes.pl_post_props.pageParent.post_parent.list = '.json_encode(pagelayer_parent_post_prop($post)).';
162
+ pagelayer_ajax_post_data = {};';
163
 
164
  // Detect JS via givejs for better performance
165
  if(empty($pagelayer->settings['enable_giver'])){
240
 
241
  if(!empty($pagelayer->data_attr)){
242
  echo '<script>
243
+ pagelayer_default_params = '.json_encode($pagelayer->default_params).';
244
  pagelayer.el = '.json_encode($pagelayer->data_attr).';
245
  </script>';
246
  }
main/post_metas.php CHANGED
@@ -69,7 +69,7 @@ function pagelayer_meta_page(){
69
 
70
  $locations = array( 'side', 'normal', 'advanced' );
71
  $priorities = array( 'high', 'sorted', 'core', 'default', 'low' );
72
- $to_remove_box = array('revisionsdiv', 'commentsdiv', 'formatdiv');
73
 
74
  // Remove meta boxes from pagelayer settings
75
  $to_remove_box = apply_filters('pagelayer_remove_meta_boxes', $to_remove_box);
@@ -89,7 +89,7 @@ function pagelayer_meta_page(){
89
 
90
  // Add format div again to change the position
91
  if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) {
92
- add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'default', array( '__back_compat_meta_box' => true ) );
93
  }
94
 
95
  // TO show all hidden meta boxes
@@ -98,24 +98,15 @@ function pagelayer_meta_page(){
98
  }, 999, 3);
99
 
100
  $props_tabs = array(
101
- 'post_props' => array(
102
- 'label' => __('Properties'),
103
- 'icon' => 'dashicons dashicons-welcome-write-blog',
104
- 'class' => 'pagelayer-active-item',
105
- ),
106
  'advanced_props' => array(
107
  'label' => __('Advanced'),
108
  'icon' => 'dashicons dashicons-welcome-add-page',
 
109
  ),
110
  'hf_code' => array(
111
  'label' => __('Header and Footer'),
112
  'icon' => 'dashicons dashicons-editor-code',
113
  ),
114
- 'body_style' => array(
115
- 'label' => __('Body Style'),
116
- 'icon' => 'dashicons dashicons-admin-generic',
117
- 'attr' => 'onclick="pagelayer_open_body_props()"',
118
- )
119
  );
120
 
121
  $props_tabs = apply_filters('pagelayer_post_props_tabs', $props_tabs);
@@ -353,39 +344,8 @@ jQuery(document).ready(function(){
353
  // Do active tab
354
  jQuery('.pagelayer-modal .pagelayer-tab-items.pagelayer-active-item').first().click();
355
 
356
- // TODO:- conform - Add publish option
357
- var post_status = jQuery('.pagelayer-modal select[name="post_status"]');
358
- var publish = post_status.find('option[value="publish"]').length > 0;
359
- var future = post_status.find('option[value="future"]').length > 0;
360
-
361
- if(! publish && !future){
362
- post_status.append('<option value="publish"><?php _e( "Published" ); ?></option>');
363
- }
364
-
365
  });
366
 
367
- function pagelayer_open_body_props(){
368
-
369
- var doc = jQuery(window.parent.document);
370
- var setting = doc.find('.pagelayer-settings-icon');
371
-
372
- if(setting.length < 1){
373
- return;
374
- }
375
-
376
- setting.attr('pagelayer-modal-none', 1);
377
- setting.click();
378
- doc.find('[pagelayer-elpd-tab=settings]').hide();
379
- doc.find('.pagelayer-props-modal').click();
380
- var opt = doc.find('[pagelayer-elpd-tab="options"]');
381
- opt.click().addClass("highlight");
382
- setting.removeAttr('pagelayer-modal-none');
383
- setTimeout(function(){
384
- opt.removeClass("highlight")
385
- }, 5000);
386
-
387
- }
388
-
389
  // Prevent the click Inside the meta pages
390
  function pagelayer_prevent_click_metas(){
391
  jQuery(document).on("submit", function(event){
@@ -456,28 +416,14 @@ function pagelayer_prevent_click_metas(){
456
 
457
  </div>
458
  <!-- End Tabs-->
459
- <!-- Start Tab panels -->
460
- <div class="pagelayer-modal-content pagelayer-show" tab-panel="post_props">
461
- <div class="pagelayer-modal-header">
462
- <h2><?php _e('Post Props') ?></h2>
463
- </div>
464
- <div class="pagelayer-modal-body">
465
- <div class="pagelayer-inner-body metabox-holder pagelayer-side-meta">
466
- <div class="pagelayer-post-title"><?php pagelayer_post_title();?></div>
467
- <?php do_meta_boxes( $post_type, 'side', $post );?>
468
- </div>
469
- <div class="pagelayer-inner-footer">
470
- <input type="submit" class="pagelayer-save-btn" name="pagelayer_submit" value="<?php _e('Save Changes'); ?>">
471
- </div>
472
- </div>
473
- </div>
474
- <div class="pagelayer-modal-content pagelayer-hidden" tab-panel="advanced_props">
475
  <div class="pagelayer-modal-header">
476
  <h2><?php _e('Advanced Props') ?></h2>
477
  </div>
478
  <div class="pagelayer-modal-body">
479
  <div class="pagelayer-inner-body metabox-holder">
480
  <?php
 
481
  do_meta_boxes( $post_type, 'normal', $post );
482
  do_meta_boxes( $post_type, 'advanced', $post );
483
  ?>
69
 
70
  $locations = array( 'side', 'normal', 'advanced' );
71
  $priorities = array( 'high', 'sorted', 'core', 'default', 'low' );
72
+ $to_remove_box = array('submitdiv', 'categorydiv', 'tagsdiv-post_tag', 'pageparentdiv', 'postimagediv', 'revisionsdiv', 'commentsdiv', 'formatdiv', 'postexcerpt', 'commentstatusdiv', 'slugdiv', 'authordiv');
73
 
74
  // Remove meta boxes from pagelayer settings
75
  $to_remove_box = apply_filters('pagelayer_remove_meta_boxes', $to_remove_box);
89
 
90
  // Add format div again to change the position
91
  if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) {
92
+ add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'normal', 'default', array( '__back_compat_meta_box' => true ) );
93
  }
94
 
95
  // TO show all hidden meta boxes
98
  }, 999, 3);
99
 
100
  $props_tabs = array(
 
 
 
 
 
101
  'advanced_props' => array(
102
  'label' => __('Advanced'),
103
  'icon' => 'dashicons dashicons-welcome-add-page',
104
+ 'class' => 'pagelayer-active-item',
105
  ),
106
  'hf_code' => array(
107
  'label' => __('Header and Footer'),
108
  'icon' => 'dashicons dashicons-editor-code',
109
  ),
 
 
 
 
 
110
  );
111
 
112
  $props_tabs = apply_filters('pagelayer_post_props_tabs', $props_tabs);
344
  // Do active tab
345
  jQuery('.pagelayer-modal .pagelayer-tab-items.pagelayer-active-item').first().click();
346
 
 
 
 
 
 
 
 
 
 
347
  });
348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  // Prevent the click Inside the meta pages
350
  function pagelayer_prevent_click_metas(){
351
  jQuery(document).on("submit", function(event){
416
 
417
  </div>
418
  <!-- End Tabs-->
419
+ <div class="pagelayer-modal-content" tab-panel="advanced_props">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  <div class="pagelayer-modal-header">
421
  <h2><?php _e('Advanced Props') ?></h2>
422
  </div>
423
  <div class="pagelayer-modal-body">
424
  <div class="pagelayer-inner-body metabox-holder">
425
  <?php
426
+ do_meta_boxes( $post_type, 'side', $post );
427
  do_meta_boxes( $post_type, 'normal', $post );
428
  do_meta_boxes( $post_type, 'advanced', $post );
429
  ?>
main/settings.php CHANGED
@@ -444,8 +444,22 @@ function pagelayer_settings_page(){
444
 
445
  }
446
 
447
- // Media Replace
448
  $disable_clone = get_option('pagelayer_disable_clone');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
 
450
  // Saved ?
451
  if(!empty($done)){
@@ -513,6 +527,14 @@ function pagelayer_settings_page(){
513
  </label>
514
  </td>
515
  </tr>
 
 
 
 
 
 
 
 
516
  </table>
517
  </div>
518
  <div class="pagelayer-tab-panel" id="icons">
444
 
445
  }
446
 
447
+ // Disable Clone
448
  $disable_clone = get_option('pagelayer_disable_clone');
449
+
450
+ // Dark Mode
451
+ if(isset($_POST['submit']) || isset($_POST['pagelayer_enable_dark_mode'])){
452
+
453
+ $enable_dark_mode = empty($_REQUEST['pagelayer_enable_dark_mode']) ? 0 : 1;
454
+
455
+ update_option( 'pagelayer_enable_dark_mode', $enable_dark_mode );
456
+
457
+ $done = 1;
458
+
459
+ }
460
+
461
+ // Dark Mode
462
+ $enable_dark_mode = get_option('pagelayer_enable_dark_mode');
463
 
464
  // Saved ?
465
  if(!empty($done)){
527
  </label>
528
  </td>
529
  </tr>
530
+ <tr>
531
+ <th scope="row"><?php _e('Dark Mode');?></th>
532
+ <td>
533
+ <label>
534
+ <input type="checkbox" name="pagelayer_enable_dark_mode" <?php echo (!empty($enable_dark_mode) ? 'checked' : '');?> /><?php _e('Enable Dark Mode') ?></br>
535
+ </label>
536
+ </td>
537
+ </tr>
538
  </table>
539
  </div>
540
  <div class="pagelayer-tab-panel" id="icons">
main/shortcode_functions.php CHANGED
@@ -148,6 +148,9 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
148
  $el['classes'][] = 'p-'.$el['id'];
149
  $el['classes'][] = $class;
150
 
 
 
 
151
  //pagelayer_print($el);
152
 
153
  // Lets create the CSS, Classes, Attr. Also clean the dependent atts
@@ -249,6 +252,21 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
249
 
250
  }
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  // Handle the edit fields
253
  if(!empty($param['edit'])){
254
  $el['edit'][$prop] = $param['edit'];
@@ -518,6 +536,17 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
518
 
519
  }
520
 
 
 
 
 
 
 
 
 
 
 
 
521
  // Add the classes
522
  if(!empty($el['classes'])){
523
 
@@ -784,8 +813,16 @@ function pagelayer_sc_post_props(&$el){
784
  $el['oAtts']['post_title'] = $post->post_title;
785
  $el['oAtts']['post_name'] = $post->post_name;
786
  $el['oAtts']['post_excerpt'] = $post->post_excerpt;
787
- $el['oAtts']['post_status'] = $post->post_status;
 
788
  $el['oAtts']['featured_image'] = get_post_thumbnail_id($post);
 
 
 
 
 
 
 
789
 
790
  // Load featured image details
791
  if(!empty($el['oAtts']['featured_image'])){
148
  $el['classes'][] = 'p-'.$el['id'];
149
  $el['classes'][] = $class;
150
 
151
+ // Register hook to filter $el
152
+ $el = apply_filters('pagelayer_do_shortcode_el', $el);
153
+
154
  //pagelayer_print($el);
155
 
156
  // Lets create the CSS, Classes, Attr. Also clean the dependent atts
252
 
253
  }
254
 
255
+ // Load any attachment values - This should go on top in the newer version @TODO
256
+ if($param['type'] == 'multi_image'){
257
+
258
+ $img_ids = explode(',', $el['atts'][$prop]);
259
+ $img_urls = [];
260
+
261
+ // Make the image URL
262
+ foreach($img_ids as $k => $v){
263
+ $image = pagelayer_image($v);
264
+ $img_urls['i'.$v] = @$image['url'];
265
+ }
266
+
267
+ $el['tmp'][$prop.'-urls'] = json_encode($img_urls);
268
+ }
269
+
270
  // Handle the edit fields
271
  if(!empty($param['edit'])){
272
  $el['edit'][$prop] = $param['edit'];
536
 
537
  }
538
 
539
+ // Add the post data editable
540
+ if(pagelayer_is_live() && !empty($pagelayer->shortcodes[$tag]['edit_props']) && is_array($pagelayer->shortcodes[$tag]['edit_props'])){
541
+
542
+ $edit_props = $pagelayer->shortcodes[$tag]['edit_props'];
543
+
544
+ foreach($edit_props as $k => $v){
545
+ $node->query($k)->attr('pagelayer-props-editable', $v);
546
+ }
547
+
548
+ }
549
+
550
  // Add the classes
551
  if(!empty($el['classes'])){
552
 
813
  $el['oAtts']['post_title'] = $post->post_title;
814
  $el['oAtts']['post_name'] = $post->post_name;
815
  $el['oAtts']['post_excerpt'] = $post->post_excerpt;
816
+ $el['oAtts']['post_status'] = (empty($post->post_password)) ? $post->post_status : 'pass_protected';
817
+ $el['oAtts']['post_password'] = $post->post_password;
818
  $el['oAtts']['featured_image'] = get_post_thumbnail_id($post);
819
+ $el['oAtts']['comment_status'] = ($post->comment_status == 'open') ? 'true' : '';
820
+ $el['oAtts']['ping_status'] = ($post->ping_status == 'open') ? 'true' : '';
821
+ $el['oAtts']['post_date'] = $post->post_date;
822
+ $el['oAtts']['post_sticky'] = is_sticky($post->ID) ? 'true' : '';
823
+ $el['oAtts']['post_parent'] = $post->post_parent;
824
+ $el['oAtts']['menu_order'] = $post->menu_order;
825
+ $el['oAtts']['post_author'] = $post->post_author;
826
 
827
  // Load featured image details
828
  if(!empty($el['oAtts']['featured_image'])){
main/shortcodes.php CHANGED
@@ -95,6 +95,11 @@ if(!defined('PAGELAYER_VERSION')) {
95
  'rel="{{rel}}"',
96
  ],
97
 
 
 
 
 
 
98
  */
99
 
100
  ////////////////////////
@@ -2872,7 +2877,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_text', array(
2872
  'text' => array(
2873
  'type' => 'editor',
2874
  'label' => __pl('Edit Rich Text'),
2875
- 'default' => 'Lorem ipsum dolor sit amet',
2876
  'desc' => __pl('Edit the content here or edit directly in the Editor'),
2877
  'edit' => '.pagelayer-text-holder', // Edit the text and also mirror the same
2878
  )
@@ -3828,6 +3833,14 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_badge', array(
3828
  'type' => 'link',
3829
  'label' => __pl('badge_url_label'),
3830
  ),
 
 
 
 
 
 
 
 
3831
  'badge_notification_type' => array(
3832
  'type' => 'select',
3833
  'label' => __pl('badge_notification_type'),
@@ -3844,6 +3857,44 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_badge', array(
3844
  'custom' => __pl('Custom'),
3845
  ],
3846
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3847
  'badge_style_type' => array(
3848
  'type' => 'select',
3849
  'label' => __pl('badge_style'),
@@ -3875,11 +3926,27 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_badge', array(
3875
  'default' => 'Your custom text',
3876
  'edit' => '.pagelayer-badge-text',
3877
  ),
 
 
 
 
 
 
 
 
 
3878
  'text_color' => array(
3879
  'type' => 'color',
3880
  'label' => __pl('badge_text_color_label'),
3881
  'default' => '#000000',
3882
- 'css' => ['{{element}} .pagelayer-badge-text' => 'color:{{val}};'],
 
 
 
 
 
 
 
3883
  ),
3884
  'text_style' => array(
3885
  'type' => 'typography',
@@ -4121,7 +4188,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_tooltip', array(
4121
  'tooltip_shadow' => array(
4122
  'type' => 'box_shadow',
4123
  'label' => __pl('tooltip_shadow'),
4124
- 'css' => ['{{element}} .pagelayer-tooltip-text' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[3]}};'],
4125
  ),
4126
  ],
4127
  'icon_style' => [
@@ -4190,7 +4257,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image', array(
4190
  'name' => __pl('image'),
4191
  'group' => 'image',
4192
  'innerHTML' => 'text',
4193
- 'html' => '<div class="pagelayer-image-holder">
4194
  <a if-ext="{{link_type}}" class="pagelayer-ele-link" href="{{func_link}}" pagelayer-image-link-type="{{link_type}}">
4195
  <img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_id}}" title="{{{id-title}}}" alt="{{{id-alt}}}" />
4196
  <div if="{{overlay}}" class="pagelayer-image-overlay {{content_position}}">
@@ -4271,7 +4338,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image', array(
4271
  'type' => 'box_shadow',
4272
  'label' => __pl('shadow'),
4273
  'screen' => 1,
4274
- 'css' => ['{{element}} img' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[3]}} !important;'],
4275
  'show' => ['img_hover' => 'normal']
4276
  ),
4277
  'img_rotate' => array(
@@ -4307,7 +4374,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_image', array(
4307
  'type' => 'box_shadow',
4308
  'label' => __pl('shadow'),
4309
  'screen' => 1,
4310
- 'css' => ['{{element}} img:hover' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[3]}} !important;'],
4311
  'show' => ['img_hover' => 'hover']
4312
  ),
4313
  'img_rotate_hover' => array(
@@ -4750,7 +4817,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_grid_gallery', array(
4750
  ),
4751
  'custom_size' => array(
4752
  'type' => 'dimension',
4753
- 'desc' => __pl('image_custom_size_label'),
4754
  'req' => array(
4755
  'size' => 'custom'
4756
  ),
@@ -4801,6 +4868,9 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_grid_gallery', array(
4801
  'left' => __pl('left'),
4802
  'center' => __pl('center'),
4803
  'right' => __pl('right')
 
 
 
4804
  )
4805
  ),
4806
  'caption_color' => array(
@@ -5092,7 +5162,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_btn', array(
5092
  'btn_shadow_hover' => [ // This is actually box shadow hover
5093
  'type' => 'box_shadow',
5094
  'label' => __pl('box_shadow_hover'),
5095
- 'css' => ['{{element}} .pagelayer-btn-holder:hover' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[3]}} !important;'],
5096
  ],
5097
  ],
5098
  'border_style' => [
@@ -5450,6 +5520,27 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_social_grp', array(
5450
  ),
5451
  'show' => ['social_hover' => '']
5452
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5453
  'anim_hover' => array(
5454
  'type' => 'select',
5455
  'label' => __pl('icon_animation'),
@@ -5482,7 +5573,8 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_social_grp', array(
5482
  'wobble-bottom' => __pl('Wobble Bottom'),
5483
  'wobble-skew' => __pl('Wobble Skew'),
5484
  ],
5485
- 'addAttr' => 'pagelayer-animation="{{anim_hover}}"'
 
5486
  ),
5487
  'icon_border_type' => array(
5488
  'type' => 'select',
@@ -5543,27 +5635,6 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_social_grp', array(
5543
  'social_hover' => 'hover'
5544
  ),
5545
  ),
5546
- 'icon_color_hover' => array(
5547
- 'type' => 'color',
5548
- 'label' => __pl('social_color_label'),
5549
- 'default' => '#ffffff',
5550
- 'css' => ['{{element}} .pagelayer-icon-holder:hover .pagelayer-social-fa' => 'color: {{val}} !important;'],
5551
- 'req' => array(
5552
- 'color_scheme' => ''
5553
- ),
5554
- 'show' => ['social_hover' => 'hover']
5555
- ),
5556
- 'icon_bg_color_hover' => array(
5557
- 'type' => 'color',
5558
- 'label' => __pl('social_bg_color_label'),
5559
- 'default' => '#0986c0',
5560
- 'css' => ['{{element}} .pagelayer-icon-holder:hover' => 'background-color: {{val}} !important;'],
5561
- 'req' => array(
5562
- '!bg_shape' => '',
5563
- 'color_scheme' => ''
5564
- ),
5565
- 'show' => ['social_hover' => 'hover']
5566
- ),
5567
  'icon_border_type_hover' => array(
5568
  'type' => 'select',
5569
  'label' => __pl('border_type'),
@@ -5746,7 +5817,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_service', array(
5746
  'innerHTML' => 'service_text',
5747
  'html' => '<div class="pagelayer-service-container pagelayer-service-align-{{service_alignment}} pagelayer-service-vertical-{{service_vertical_alignment}}">
5748
  <div if="{{service_image}}" class="pagelayer-service-image">
5749
- <img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_image}}">
5750
  </div>
5751
  <div class="pagelayer-service-details">
5752
  <a if-ext={{heading_url}} href="{{{heading_url}}}" class="pagelayer-ele-link">
@@ -7388,7 +7459,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_tab', array(
7388
  'not_visible' => 1,
7389
  'has_group' => [
7390
  'section' => 'params',
7391
- 'prop' => 'elements'
7392
  ],
7393
  'holder' => '.pagelayer-tabcontent',
7394
  'html' => '<div class="pagelayer-tabcontent"></div>',
@@ -7396,11 +7467,19 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_tab', array(
7396
  'elements' => array(
7397
  'type' => 'group',
7398
  'label' => __pl('Inner Row'),
7399
- 'sc' => PAGELAYER_SC_PREFIX.'_inner_row',
7400
  'count' => 1,
7401
  'item_label' => array(
7402
  'default' => __pl('Inner Row'),
7403
  ),
 
 
 
 
 
 
 
 
7404
  'hide' => 1,
7405
  ),
7406
  'default_active' => array(
@@ -7825,7 +7904,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_space', array(
7825
  'type' => 'slider',
7826
  'label' => __pl('Space Height'),
7827
  'screen' => 1,
7828
- 'units' => ['px', '%'],
7829
  'css' => ['{{element}} .pagelayer-space-holder' => 'height: {{val}};'],
7830
  'default' => '10',
7831
  'min' => 0,
@@ -7918,7 +7997,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_testimonial', array(
7918
  'html' => '<div if="{{quote_content}}" class="pagelayer-testimonial-content">{{quote_content}}</div>
7919
  <div class="pagelayer-testimonial-author-details">
7920
  <div if="{{avatar}}" class="pagelayer-{{image_position}}">
7921
- <img class="pagelayer-img pagelayer-testimonial-image pagelayer-testimonial-{{img_shape}}" src="{{func_image}}" />
7922
  </div>
7923
  <div class="pagelayer-{{image_position}}">
7924
  <div if="{{cite}}" class="pagelayer-testimonial-cite">
@@ -7976,6 +8055,7 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_testimonial', array(
7976
  'avatar' => array(
7977
  'type' => 'image',
7978
  'label' => __pl('testimonial_image_label'),
 
7979
  'desc' => __pl('testimonial_image_desc'),
7980
  ),
7981
  'testimonial_image_size' => array(
@@ -8969,10 +9049,127 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_post_props', array(
8969
  'not_visible' => 1,
8970
  'overide_css_selector' => 'body',
8971
  'hide_active' => 1,
 
8972
  'skip_props_cat' => ['position_styles', 'animation_styles', 'responsive_styles', 'motion_effects'],
8973
  'skip_props' => ['ele_zindex',
8974
  'ele_shadow', 'border_shadow_hover',
8975
  'hide_desktop', 'hide_tablet', 'hide_mobile'],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8976
  )
8977
  );
8978
 
@@ -9027,24 +9224,31 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_wp_widgets', array(
9027
  //include_once(ABSPATH . 'wp-admin/includes/widgets.php');
9028
 
9029
  //pagelayer_print($GLOBALS['wp_widget_factory']->widgets);die();
9030
-
 
 
9031
  foreach($GLOBALS['wp_widget_factory']->widgets as $widget_key => $widget){
9032
 
9033
- pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_wp_'.$widget->id_base, array(
9034
- 'name' => $widget->name,
9035
- 'group' => 'wordpress',
9036
- 'func' => 'pagelayer_does_not_exist',
9037
- 'innerHTML' => 'widget_data',
9038
- 'widget' => $widget_key,
9039
- 'params'=>array(
9040
- 'widget_data' => array(
9041
- 'type' => 'text',
9042
- 'not_visible' => 1,
9043
- )
9044
  )
9045
  )
9046
  );
9047
 
 
 
 
 
 
 
9048
  }
9049
  //}
9050
 
95
  'rel="{{rel}}"',
96
  ],
97
 
98
+ // Define group and set default content if it has inner_row child
99
+ 'has_group' => [
100
+ 'section' => 'params',
101
+ 'prop' => 'elements',
102
+ ],
103
  */
104
 
105
  ////////////////////////
2877
  'text' => array(
2878
  'type' => 'editor',
2879
  'label' => __pl('Edit Rich Text'),
2880
+ 'default' => '<p>Lorem ipsum dolor sit amet</p>',
2881
  'desc' => __pl('Edit the content here or edit directly in the Editor'),
2882
  'edit' => '.pagelayer-text-holder', // Edit the text and also mirror the same
2883
  )
3833
  'type' => 'link',
3834
  'label' => __pl('badge_url_label'),
3835
  ),
3836
+ 'badge_target' => array(
3837
+ 'label' => __pl('open_link_in_new_window'),
3838
+ 'type' => 'checkbox',
3839
+ 'addAttr' => ['{{element}} a' => 'target="_blank"'],
3840
+ 'req' => array(
3841
+ '!badge_url' => ''
3842
+ )
3843
+ ),
3844
  'badge_notification_type' => array(
3845
  'type' => 'select',
3846
  'label' => __pl('badge_notification_type'),
3857
  'custom' => __pl('Custom'),
3858
  ],
3859
  ),
3860
+ 'custom_badge_state' => array(
3861
+ 'type' => 'radio',
3862
+ 'label' => __pl('state'),
3863
+ 'default' => '',
3864
+ 'list' => array(
3865
+ '' => __pl('normal'),
3866
+ 'hover' => __pl('hover'),
3867
+ ),
3868
+ 'req' => ['badge_notification_type' => 'custom'],
3869
+ ),
3870
+ 'custom_badge_text_color' => array(
3871
+ 'type' => 'color',
3872
+ 'label' => __pl('badge_text_color_label'),
3873
+ 'css' => ['{{element}} .pagelayer-badge-title' => 'color:{{val}} !important;'],
3874
+ 'show' => ['custom_badge_state' => ''],
3875
+ 'req' => ['badge_notification_type' => 'custom'],
3876
+ ),
3877
+ 'custom_badge_bg_color' => array(
3878
+ 'type' => 'color',
3879
+ 'label' => __pl('bg_color'),
3880
+ 'css' => ['{{element}} .pagelayer-badge-title' => 'background-color:{{val}} !important;'],
3881
+ 'show' => ['custom_badge_state' => ''],
3882
+ 'req' => ['badge_notification_type' => 'custom'],
3883
+ ),
3884
+ 'custom_badge_text_color_hover' => array(
3885
+ 'type' => 'color',
3886
+ 'label' => __pl('badge_text_color_label'),
3887
+ 'css' => ['{{element}} .pagelayer-badge-title:hover' => 'color:{{val}} !important;'],
3888
+ 'show' => ['custom_badge_state' => 'hover'],
3889
+ 'req' => ['badge_notification_type' => 'custom'],
3890
+ ),
3891
+ 'custom_badge_bg_color_hover' => array(
3892
+ 'type' => 'color',
3893
+ 'label' => __pl('bg_color'),
3894
+ 'css' => ['{{element}} .pagelayer-badge-title:hover' => 'background-color:{{val}} !important;'],
3895
+ 'show' => ['custom_badge_state' => 'hover'],
3896
+ 'req' => ['badge_notification_type' => 'custom'],
3897
+ ),
3898
  'badge_style_type' => array(
3899
  'type' => 'select',
3900
  'label' => __pl('badge_style'),
3926
  'default' => 'Your custom text',
3927
  'edit' => '.pagelayer-badge-text',
3928
  ),
3929
+ 'text_state' => array(
3930
+ 'type' => 'radio',
3931
+ 'label' => __pl('state'),
3932
+ 'default' => '',
3933
+ 'list' => array(
3934
+ '' => __pl('normal'),
3935
+ 'hover' => __pl('hover'),
3936
+ )
3937
+ ),
3938
  'text_color' => array(
3939
  'type' => 'color',
3940
  'label' => __pl('badge_text_color_label'),
3941
  'default' => '#000000',
3942
+ 'css' => ['{{element}} .pagelayer-badge-text' => 'color:{{val}};'],
3943
+ 'show' => ['text_state' => '']
3944
+ ),
3945
+ 'text_color_hover' => array(
3946
+ 'type' => 'color',
3947
+ 'label' => __pl('badge_text_color_label'),
3948
+ 'css' => ['{{element}} .pagelayer-badge-text:hover' => 'color:{{val}};'],
3949
+ 'show' => ['text_state' => 'hover']
3950
  ),
3951
  'text_style' => array(
3952
  'type' => 'typography',
4188
  'tooltip_shadow' => array(
4189
  'type' => 'box_shadow',
4190
  'label' => __pl('tooltip_shadow'),
4191
+ 'css' => ['{{element}} .pagelayer-tooltip-text' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[4]}}px {{val[3]}} {{val[5]}};'],
4192
  ),
4193
  ],
4194
  'icon_style' => [
4257
  'name' => __pl('image'),
4258
  'group' => 'image',
4259
  'innerHTML' => 'text',
4260
+ 'html' => '<div class="pagelayer-image-holder pagelayer-anim-par">
4261
  <a if-ext="{{link_type}}" class="pagelayer-ele-link" href="{{func_link}}" pagelayer-image-link-type="{{link_type}}">
4262
  <img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_id}}" title="{{{id-title}}}" alt="{{{id-alt}}}" />
4263
  <div if="{{overlay}}" class="pagelayer-image-overlay {{content_position}}">
4338
  'type' => 'box_shadow',
4339
  'label' => __pl('shadow'),
4340
  'screen' => 1,
4341
+ 'css' => ['{{element}} img' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[4]}}px {{val[3]}} {{val[5]}} !important;'],
4342
  'show' => ['img_hover' => 'normal']
4343
  ),
4344
  'img_rotate' => array(
4374
  'type' => 'box_shadow',
4375
  'label' => __pl('shadow'),
4376
  'screen' => 1,
4377
+ 'css' => ['{{element}} img:hover' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[4]}}px {{val[3]}} {{val[5]}} !important;'],
4378
  'show' => ['img_hover' => 'hover']
4379
  ),
4380
  'img_rotate_hover' => array(
4817
  ),
4818
  'custom_size' => array(
4819
  'type' => 'dimension',
4820
+ 'label' => __pl('image_custom_size_label'),
4821
  'req' => array(
4822
  'size' => 'custom'
4823
  ),
4868
  'left' => __pl('left'),
4869
  'center' => __pl('center'),
4870
  'right' => __pl('right')
4871
+ ),
4872
+ 'req' => array(
4873
+ 'caption' => 'true'
4874
  )
4875
  ),
4876
  'caption_color' => array(
5162
  'btn_shadow_hover' => [ // This is actually box shadow hover
5163
  'type' => 'box_shadow',
5164
  'label' => __pl('box_shadow_hover'),
5165
+ 'css' => ['{{element}} .pagelayer-btn-holder:hover' => 'box-shadow: {{val[0]}}px {{val[1]}}px {{val[2]}}px {{val[4]}}px {{val[3]}} {{val[5]}} !important;'],
5166
  ],
5167
  ],
5168
  'border_style' => [
5520
  ),
5521
  'show' => ['social_hover' => '']
5522
  ),
5523
+ 'icon_color_hover' => array(
5524
+ 'type' => 'color',
5525
+ 'label' => __pl('social_color_label'),
5526
+ 'default' => '#ffffff',
5527
+ 'css' => ['{{element}} .pagelayer-icon-holder:hover .pagelayer-social-fa' => 'color: {{val}} !important;'],
5528
+ 'req' => array(
5529
+ 'color_scheme' => ''
5530
+ ),
5531
+ 'show' => ['social_hover' => 'hover']
5532
+ ),
5533
+ 'icon_bg_color_hover' => array(
5534
+ 'type' => 'color',
5535
+ 'label' => __pl('social_bg_color_label'),
5536
+ 'default' => '#0986c0',
5537
+ 'css' => ['{{element}} .pagelayer-icon-holder:hover' => 'background-color: {{val}} !important;'],
5538
+ 'req' => array(
5539
+ '!bg_shape' => '',
5540
+ 'color_scheme' => ''
5541
+ ),
5542
+ 'show' => ['social_hover' => 'hover']
5543
+ ),
5544
  'anim_hover' => array(
5545
  'type' => 'select',
5546
  'label' => __pl('icon_animation'),
5573
  'wobble-bottom' => __pl('Wobble Bottom'),
5574
  'wobble-skew' => __pl('Wobble Skew'),
5575
  ],
5576
+ 'addAttr' => 'pagelayer-animation="{{anim_hover}}"',
5577
+ 'show' => ['social_hover' => 'hover']
5578
  ),
5579
  'icon_border_type' => array(
5580
  'type' => 'select',
5635
  'social_hover' => 'hover'
5636
  ),
5637
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5638
  'icon_border_type_hover' => array(
5639
  'type' => 'select',
5640
  'label' => __pl('border_type'),
5817
  'innerHTML' => 'service_text',
5818
  'html' => '<div class="pagelayer-service-container pagelayer-service-align-{{service_alignment}} pagelayer-service-vertical-{{service_vertical_alignment}}">
5819
  <div if="{{service_image}}" class="pagelayer-service-image">
5820
+ <img class="pagelayer-img pagelayer-animation-{{anim_hover}}" src="{{func_image}}" title="{{{service_image-title}}}" alt="{{{service_image-alt}}}" />
5821
  </div>
5822
  <div class="pagelayer-service-details">
5823
  <a if-ext={{heading_url}} href="{{{heading_url}}}" class="pagelayer-ele-link">
7459
  'not_visible' => 1,
7460
  'has_group' => [
7461
  'section' => 'params',
7462
+ 'prop' => 'elements',
7463
  ],
7464
  'holder' => '.pagelayer-tabcontent',
7465
  'html' => '<div class="pagelayer-tabcontent"></div>',
7467
  'elements' => array(
7468
  'type' => 'group',
7469
  'label' => __pl('Inner Row'),
7470
+ 'sc' => PAGELAYER_SC_PREFIX.'_inner_row', // a.k.a the item being multiplied by the count
7471
  'count' => 1,
7472
  'item_label' => array(
7473
  'default' => __pl('Inner Row'),
7474
  ),
7475
+ 'item_atts' => [], // orderwise array of attrbutes to be set as per the count given
7476
+ 'inner_content' => [ // This is the content within each item which is going to the created i.e. within each SC. This only use for inner rows
7477
+ ['pl_col' => [
7478
+ 'inner_content' => [
7479
+ ['pl_text' => [ 'atts' => ['text' => 'This is the default Tab content. Feel free to delete it.']]]
7480
+ ]]
7481
+ ]
7482
+ ],
7483
  'hide' => 1,
7484
  ),
7485
  'default_active' => array(
7904
  'type' => 'slider',
7905
  'label' => __pl('Space Height'),
7906
  'screen' => 1,
7907
+ 'units' => ['px', 'em'],
7908
  'css' => ['{{element}} .pagelayer-space-holder' => 'height: {{val}};'],
7909
  'default' => '10',
7910
  'min' => 0,
7997
  'html' => '<div if="{{quote_content}}" class="pagelayer-testimonial-content">{{quote_content}}</div>
7998
  <div class="pagelayer-testimonial-author-details">
7999
  <div if="{{avatar}}" class="pagelayer-{{image_position}}">
8000
+ <img class="pagelayer-img pagelayer-testimonial-image pagelayer-testimonial-{{img_shape}}" src="{{func_image}}" title="{{{avatar-title}}}" alt="{{{avatar-alt}}}"/>
8001
  </div>
8002
  <div class="pagelayer-{{image_position}}">
8003
  <div if="{{cite}}" class="pagelayer-testimonial-cite">
8055
  'avatar' => array(
8056
  'type' => 'image',
8057
  'label' => __pl('testimonial_image_label'),
8058
+ 'default' => PAGELAYER_URL.'/images/default-image.png',
8059
  'desc' => __pl('testimonial_image_desc'),
8060
  ),
8061
  'testimonial_image_size' => array(
9049
  'not_visible' => 1,
9050
  'overide_css_selector' => 'body',
9051
  'hide_active' => 1,
9052
+ 'skip_props_cat_type' => ['product' => ['custom_hf_code']],
9053
  'skip_props_cat' => ['position_styles', 'animation_styles', 'responsive_styles', 'motion_effects'],
9054
  'skip_props' => ['ele_zindex',
9055
  'ele_shadow', 'border_shadow_hover',
9056
  'hide_desktop', 'hide_tablet', 'hide_mobile'],
9057
+ 'params' => array(
9058
+ 'post_title' => array(
9059
+ 'type' => 'text',
9060
+ 'label' => __pl('post_title'),
9061
+ 'default' => (empty($post->post_title) ? 'No Title' : $post->post_title),
9062
+ 'export-def' => 1,
9063
+ ),
9064
+ 'post_status' => array(
9065
+ 'type' => 'select',
9066
+ 'label' => __pl('visibility'),
9067
+ 'default' => (empty($post->post_status) ? 'draft' : $post->post_status),
9068
+ 'export-def' => 1,
9069
+ 'list' => [
9070
+ 'publish' => __pl('Published'),
9071
+ 'future' => __pl('Scheduled'),
9072
+ 'private' => __pl('private'),
9073
+ 'pass_protected' => __pl('password_protected'),
9074
+ 'draft' => __pl('Draft')
9075
+ ],
9076
+ ),
9077
+ 'post_password' => array(
9078
+ 'type' => 'text',
9079
+ 'label' => __pl('password'),
9080
+ 'export-def' => 1,
9081
+ 'req' => ['post_status' => 'pass_protected']
9082
+ ),
9083
+ 'post_date' => array(
9084
+ 'type' => 'postDate',
9085
+ 'label' => __pl('publish_date'),
9086
+ 'default' => (empty($post->post_date) ? current_time( 'mysql' ) : $post->post_date),
9087
+ 'export-def' => 1,
9088
+ ),
9089
+ 'post_sticky' => array(
9090
+ 'type' => 'checkbox',
9091
+ 'label' => __pl('sticky_post'),
9092
+ 'default' => (empty($post->ID) ? '' : is_sticky($post->ID) ? 'true' : ''),
9093
+ 'export-def' => 1,
9094
+ ),
9095
+ 'post_author' => array(
9096
+ 'type' => 'select',
9097
+ 'label' => __pl('author'),
9098
+ 'default' => (empty($post->post_author) ? 0 : $post->post_author),
9099
+ 'list' => [],
9100
+ 'export-def' => 1,
9101
+ ),
9102
+ 'post_trash' => array(
9103
+ 'type' => 'trashButton',
9104
+ 'label' => '',
9105
+ ),
9106
+ ),
9107
+ 'postPermalink' => array(
9108
+ 'post_name' => array(
9109
+ 'type' => 'permalink',
9110
+ 'label' => __pl('url_slug'),
9111
+ 'desc' => __pl('perma_desc'),
9112
+ 'default' => (empty($post->post_name) ? '' : $post->post_name),
9113
+ 'export-def' => 1,
9114
+ ),
9115
+ ),
9116
+ 'postCategory' => array(
9117
+ 'post_category' => array(
9118
+ 'type' => 'postCategory',
9119
+ 'label' => ''
9120
+ )
9121
+ ),
9122
+ 'postTags' => array(
9123
+ 'post_tags' => array(
9124
+ 'type' => 'postTags',
9125
+ 'label' => __pl('add_new_tag'),
9126
+ )
9127
+ ),
9128
+ 'postFeaturedImage' => array(
9129
+ 'featured_image' => array(
9130
+ 'type' => 'image',
9131
+ 'label' => '',
9132
+ 'default' => ( get_post_thumbnail_id($post) ? get_post_thumbnail_id($post) : PAGELAYER_URL.'/images/default-image.png' ),
9133
+ 'export-def' => 1,
9134
+ ),
9135
+ ),
9136
+ 'postExcerpt' => array(
9137
+ 'post_excerpt' => array(
9138
+ 'type' => 'textarea',
9139
+ 'label' => __pl('write_an_excerpt'),
9140
+ )
9141
+ ),
9142
+ 'postDiscussion' => array(
9143
+ 'comment_status' => array(
9144
+ 'type' => 'checkbox',
9145
+ 'label' => __pl('allow_comments'),
9146
+ ),
9147
+ 'ping_status' => array(
9148
+ 'type' => 'checkbox',
9149
+ 'label' => __pl('allow_p_and_t'),
9150
+ )
9151
+ ),
9152
+ 'pageParent' => array(
9153
+ 'post_parent' => array(
9154
+ 'type' => 'select',
9155
+ 'label' => __pl('post_parent'),
9156
+ 'list' => []
9157
+ ),
9158
+ 'menu_order' => array(
9159
+ 'type' => 'spinner',
9160
+ 'label' => __pl('order'),
9161
+ )
9162
+ ),
9163
+ 'styles' => array(
9164
+ 'params' => __pl('status_visibility'),
9165
+ 'postPermalink' => __pl('post_name'),
9166
+ 'postCategory' => __pl('wp_categories'),
9167
+ 'postTags' => __pl('tags'),
9168
+ 'postFeaturedImage' => __pl('featured_image'),
9169
+ 'postExcerpt' => __pl('excerpt'),
9170
+ 'postDiscussion' => __pl('discussion'),
9171
+ 'pageParent' => __pl('page_attributes'),
9172
+ ),
9173
  )
9174
  );
9175
 
9224
  //include_once(ABSPATH . 'wp-admin/includes/widgets.php');
9225
 
9226
  //pagelayer_print($GLOBALS['wp_widget_factory']->widgets);die();
9227
+
9228
+ $wp_hidden_shortcode = array('media_audio', 'media_gallery', 'media_image', 'media_video');
9229
+
9230
  foreach($GLOBALS['wp_widget_factory']->widgets as $widget_key => $widget){
9231
 
9232
+ $wp_shortcode = array(
9233
+ 'name' => $widget->name,
9234
+ 'group' => 'wordpress',
9235
+ 'func' => 'pagelayer_does_not_exist',
9236
+ 'innerHTML' => 'widget_data',
9237
+ 'widget' => $widget_key,
9238
+ 'params'=>array(
9239
+ 'widget_data' => array(
9240
+ 'type' => 'text',
9241
+ 'not_visible' => 1,
 
9242
  )
9243
  )
9244
  );
9245
 
9246
+ if(in_array($widget->id_base, $wp_hidden_shortcode)){
9247
+ $wp_shortcode['not_visible'] = 1;
9248
+ }
9249
+
9250
+ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_wp_'.$widget->id_base, $wp_shortcode);
9251
+
9252
  }
9253
  //}
9254
 
main/template.php CHANGED
@@ -167,6 +167,10 @@ function pagelayer_builder_singular_conditions($post_types = []){
167
  foreach ( $post_types as $post_type => $label ) {
168
  //$post_type_object = get_post_type_object( $post_type );
169
 
 
 
 
 
170
  $condition[$label] = [ //TC: Need to change the name of variable
171
  $post_type => array(
172
  'label' => $label,
@@ -359,7 +363,7 @@ function pagelayer_builder_admin_head(){
359
  return;
360
  }
361
 
362
- if(!defined('SITEPAD')){
363
  echo '<script type="text/javascript">
364
 
365
  jQuery(document).ready(function(){
@@ -381,8 +385,7 @@ jQuery(document).ready(function(){
381
  });
382
 
383
  </script>';
384
- }
385
-
386
  }
387
 
388
  // This function will handle the Template Builder pages in PageLayer
@@ -395,10 +398,8 @@ function pagelayer_builder_post_type() {
395
  'title', // post title
396
  'editor', // post content
397
  'author', // post author
398
- 'excerpt', // post excerpt
399
  'custom-fields', // custom fields
400
  'revisions', // post revisions
401
- 'post-formats', // post formats
402
  );
403
 
404
  // Add Template Post lables
@@ -465,7 +466,7 @@ function pagelayer_builder_posts_shortcode($atts){
465
  }
466
 
467
  // Handle edit link of the post type
468
- add_filter('get_edit_post_link', 'pagelayer_builder_edit_link', 10, 3);
469
  function pagelayer_builder_edit_link($link, $postID, $context){
470
  global $pagelayer;
471
 
@@ -488,7 +489,6 @@ function pagelayer_builder_row_actions($actions, $post){
488
  return $actions;
489
  }
490
 
491
- $actions['edit'] = '<a href="'.esc_url(admin_url('admin.php?page=pagelayer_template_wizard&post='.$post->ID)).'">'.__( 'Edit', 'pagelayer') .'</a>';;
492
  $actions['pagelayer'] = '<a href="'.esc_url( pagelayer_shortlink($post->ID).'&pagelayer-live=1' ).'">'.__pl('edit_using').'</a>';
493
 
494
  return $actions;
167
  foreach ( $post_types as $post_type => $label ) {
168
  //$post_type_object = get_post_type_object( $post_type );
169
 
170
+ if(array_key_exists($label, $condition)){
171
+ continue;
172
+ }
173
+
174
  $condition[$label] = [ //TC: Need to change the name of variable
175
  $post_type => array(
176
  'label' => $label,
363
  return;
364
  }
365
 
366
+
367
  echo '<script type="text/javascript">
368
 
369
  jQuery(document).ready(function(){
385
  });
386
 
387
  </script>';
388
+
 
389
  }
390
 
391
  // This function will handle the Template Builder pages in PageLayer
398
  'title', // post title
399
  'editor', // post content
400
  'author', // post author
 
401
  'custom-fields', // custom fields
402
  'revisions', // post revisions
 
403
  );
404
 
405
  // Add Template Post lables
466
  }
467
 
468
  // Handle edit link of the post type
469
+ add_filter('get_edit_post_link', 'pagelayer_builder_edit_link', 1000, 3);
470
  function pagelayer_builder_edit_link($link, $postID, $context){
471
  global $pagelayer;
472
 
489
  return $actions;
490
  }
491
 
 
492
  $actions['pagelayer'] = '<a href="'.esc_url( pagelayer_shortlink($post->ID).'&pagelayer-live=1' ).'">'.__pl('edit_using').'</a>';
493
 
494
  return $actions;
main/website.php CHANGED
@@ -137,7 +137,7 @@ function pagelayer_website_settings(){
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{
@@ -173,8 +173,13 @@ function pagelayer_website_settings_T(){
173
 
174
  // Reduce load
175
  echo '<select id="skeleton_of_fonts" style="display:none">';
176
- foreach($pagelayer->fonts as $k => $font){
177
- echo '<option value="'.esc_html($font).'">'. esc_html(empty($font) ? 'Default': $font) .'</option>';
 
 
 
 
 
178
  }
179
  echo '</select>';
180
 
@@ -493,7 +498,7 @@ function pagelayer_website_font_settings($prefix){
493
  <option value="custom" <?php echo (!empty($vals[$prefix]['padding']) ? 'selected="seleted"' : '');?>>Custom</option>
494
  </select>
495
  <span>
496
- <?php pagelayer_website_padding_field($prefix.'[padding]', $vals[$prefix]['padding']);?>
497
  </span>
498
  </label>
499
  </td>
@@ -508,7 +513,7 @@ function pagelayer_website_font_settings($prefix){
508
  <option value="custom" <?php echo (!empty($vals[$prefix]['margin']) ? 'selected="seleted"' : '');?>>Custom</option>
509
  </select>
510
  <span>
511
- <?php pagelayer_website_padding_field($prefix.'[margin]', $vals[$prefix]['margin']);?>
512
  </span>
513
  </label>
514
  </td>
@@ -520,7 +525,7 @@ function pagelayer_website_font_settings($prefix){
520
  <label>
521
  <select name="<?php echo $prefix;?>[font-family]" onclick="pagelayer_handle_font_family(this)">
522
  <?php
523
- echo '<option value="'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': $vals[$prefix]['font-family']).'">'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': $vals[$prefix]['font-family']).'</option>';
524
  ?>
525
  </select>
526
  </label>
@@ -547,7 +552,7 @@ function pagelayer_website_font_settings($prefix){
547
  <select name="<?php echo $prefix;?>[font-style]">
548
  <?php
549
  foreach($pagelayer->font_style as $k => $var){
550
- echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['font-style'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
551
  }
552
  ?>
553
  </select>
@@ -562,7 +567,7 @@ function pagelayer_website_font_settings($prefix){
562
  <select name="<?php echo $prefix;?>[font-weight]">
563
  <?php
564
  foreach($pagelayer->font_weight as $k => $var){
565
- echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['font-weight'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
566
  }
567
  ?>
568
  </select>
@@ -577,7 +582,7 @@ function pagelayer_website_font_settings($prefix){
577
  <select name="<?php echo $prefix;?>[text-transform]">
578
  <?php
579
  foreach($pagelayer->text_transform as $k => $var){
580
- echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['text-transform'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
581
  }
582
  ?>
583
  </select>
@@ -634,7 +639,7 @@ function pagelayer_website_font_settings($prefix){
634
  <select name="<?php echo $prefix;?>[text-decoration-line]" onchange="pagelayer_handle_textdecor(this)">
635
  <?php
636
  foreach($pagelayer->text_decoration_line as $k => $var){
637
- echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['text-decoration-line'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
638
  }
639
  ?>
640
  </select>
@@ -643,7 +648,7 @@ function pagelayer_website_font_settings($prefix){
643
  <select name="<?php echo $prefix;?>[text-decoration-style]">
644
  <?php
645
  foreach($pagelayer->text_decoration_style as $k => $var){
646
- echo '<option value="'.esc_html($k).'" '.($vals[$prefix]['text-decoration-style'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
647
  }
648
  ?>
649
  </select>
137
  delete_option('pagelayer_header_code');
138
  }
139
 
140
+ // Save Footer code
141
  if(isset($_REQUEST['pagelayer_footer_code'])){
142
  update_option( 'pagelayer_footer_code', wp_unslash($_REQUEST['pagelayer_footer_code'] ));
143
  }else{
173
 
174
  // Reduce load
175
  echo '<select id="skeleton_of_fonts" style="display:none">';
176
+ foreach($pagelayer->fonts as $subType => $fontType){
177
+ if($subType != 'default'){
178
+ echo '<optgroup style="text-transform: capitalize" label="'.$subType.'">';
179
+ }
180
+ foreach($fontType as $k => $font){
181
+ echo '<option value="'.esc_html(is_numeric($k) ? $font : $k).'">'. esc_html(empty($font) ? 'Default': $font) .'</option>';
182
+ }
183
  }
184
  echo '</select>';
185
 
498
  <option value="custom" <?php echo (!empty($vals[$prefix]['padding']) ? 'selected="seleted"' : '');?>>Custom</option>
499
  </select>
500
  <span>
501
+ <?php pagelayer_website_padding_field($prefix.'[padding]', @$vals[$prefix]['padding']);?>
502
  </span>
503
  </label>
504
  </td>
513
  <option value="custom" <?php echo (!empty($vals[$prefix]['margin']) ? 'selected="seleted"' : '');?>>Custom</option>
514
  </select>
515
  <span>
516
+ <?php pagelayer_website_padding_field($prefix.'[margin]', @$vals[$prefix]['margin']);?>
517
  </span>
518
  </label>
519
  </td>
525
  <label>
526
  <select name="<?php echo $prefix;?>[font-family]" onclick="pagelayer_handle_font_family(this)">
527
  <?php
528
+ echo '<option value="'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': @$vals[$prefix]['font-family']).'">'.esc_html(empty($vals[$prefix]['font-family']) ? 'Default': @$vals[$prefix]['font-family']).'</option>';
529
  ?>
530
  </select>
531
  </label>
552
  <select name="<?php echo $prefix;?>[font-style]">
553
  <?php
554
  foreach($pagelayer->font_style as $k => $var){
555
+ echo '<option value="'.esc_html($k).'" '.(@$vals[$prefix]['font-style'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
556
  }
557
  ?>
558
  </select>
567
  <select name="<?php echo $prefix;?>[font-weight]">
568
  <?php
569
  foreach($pagelayer->font_weight as $k => $var){
570
+ echo '<option value="'.esc_html($k).'" '.(@$vals[$prefix]['font-weight'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
571
  }
572
  ?>
573
  </select>
582
  <select name="<?php echo $prefix;?>[text-transform]">
583
  <?php
584
  foreach($pagelayer->text_transform as $k => $var){
585
+ echo '<option value="'.esc_html($k).'" '.(@$vals[$prefix]['text-transform'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
586
  }
587
  ?>
588
  </select>
639
  <select name="<?php echo $prefix;?>[text-decoration-line]" onchange="pagelayer_handle_textdecor(this)">
640
  <?php
641
  foreach($pagelayer->text_decoration_line as $k => $var){
642
+ echo '<option value="'.esc_html($k).'" '.(@$vals[$prefix]['text-decoration-line'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
643
  }
644
  ?>
645
  </select>
648
  <select name="<?php echo $prefix;?>[text-decoration-style]">
649
  <?php
650
  foreach($pagelayer->text_decoration_style as $k => $var){
651
+ echo '<option value="'.esc_html($k).'" '.(@$vals[$prefix]['text-decoration-style'] == $k ? 'selected' : '').'>'.esc_html($var).'</option>';
652
  }
653
  ?>
654
  </select>
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.8
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.9
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, drag-and-drop, landing page, replace image, pagelaye
4
  Requires at least: 4.7
5
  Tested up to: 5.7
6
  Requires PHP: 5.5
7
- Stable tag: 1.4.8
8
  License: LGPL v2.1
9
  License URI: http://www.gnu.org/licenses/lgpl-2.1.html
10
 
@@ -109,6 +109,27 @@ Do you have questions related to PageLayer ? Use the following links :
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  = 1.4.8 (March 11, 2021) =
113
  * [Feature] Added the option to clone the posts/pages.
114
  * [Task] Pagelayer has been tested with WordPress 5.7 and we have made required changes.
4
  Requires at least: 4.7
5
  Tested up to: 5.7
6
  Requires PHP: 5.5
7
+ Stable tag: 1.4.9
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.9 (April 17, 2021) =
113
+ * [Feature] Added the feature to upload Custom Fonts. Users can now use fonts other than Google Fonts by uploading their choice of fonts.
114
+ * [Feature] The Page / Post properties are now visible by default while editing a post / page. We have added many options like Categories, Tags, Permalink, Publish Post at a future date, Excerpt, Discussion options, etc.
115
+ * [Feature] While editing the contact form, you can now design the success and error messages.
116
+ * [Task] By default, the page settings will now be shown while editing in Pagelayer.
117
+ * [Task] On submitting the contact form, the submit button will now show a progress circle.
118
+ * [Task] Added title and alt attributes for all possible image tags for improving accessibility reading.
119
+ * [Task] Added more options for Badge Widget.
120
+ * [Task] Added the dark mode option for the pagelayer editor, you can enable dark mode from the pagelayer setting.
121
+ * [Task] Added default inner content in the tab widget.
122
+ * [Bug-Fix] The padding for overlay in the Image Portfolio widget was not working. This is fixed.
123
+ * [Bug-Fix] The right click menu in Pagelayer Editor would cross the edges of the view port. This is fixed.
124
+ * [Bug-Fix] In case of the Address, Email or Phone Widgets, if the value exceeded the column width, the column layout would break. This is fixed.
125
+ * [Bug-Fix] When the image widget was given an animation and also had an overlay, the animation would not work. This is fixed.
126
+ * [Bug-Fix] Box shadow CSS was not working in some places. This is fixed.
127
+ * [Bug-Fix] In some cases, the dots of the Slides Widget's slider were hidden. This is fixed.
128
+ * [Bug-Fix] In some cases, some part of the "Facebook Likes" button was hidden. This is fixed.
129
+ * [Bug-Fix] When loading a page / post in editor mode, the splash modal was shown each time if the display option "Always" was set. This is fixed.
130
+ * [Bug-Fix] In some cases, the global table widget was not updated properly when editing the global table using the inline editor. This is fixed.
131
+ * [Bug-Fix] The title in the menu list widget was not edited properly using the inline editor. This is fixed.
132
+
133
  = 1.4.8 (March 11, 2021) =
134
  * [Feature] Added the option to clone the posts/pages.
135
  * [Task] Pagelayer has been tested with WordPress 5.7 and we have made required changes.