Version Description
Download this release
Release Info
Developer | unitecms |
Plugin | Unlimited Elements For Elementor (Free Widgets, Addons, Templates) |
Version | 1.4.71 |
Comparing to | |
See all releases |
Code changes from version 1.4.70 to 1.4.71
- inc_php/framework/functions.class.php +20 -0
- inc_php/unitecreator_dialog_param.class.php +32 -0
- inc_php/unitecreator_output.class.php +6 -2
- inc_php/unitecreator_settings.class.php +22 -2
- inc_php/unitecreator_template_engine.class.php +65 -19
- includes.php +1 -1
- js/unitecreator_admin.js +6 -1
- provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +13 -4
- provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +30 -10
- provider/core/plugins/unlimited_elements/elementor/pagination.class.php +6 -4
- provider/functions_wordpress.class.php +62 -9
- provider/provider_dialog_param.class.php +5 -1
- provider/provider_params_processor.class.php +193 -5
- provider/provider_settings.class.php +73 -3
- provider/provider_template_engine.class.php +0 -1
- provider/woocommerce_integrate.class.php +2 -1
- readme.txt +13 -0
- release_log.txt +13 -0
- unlimited_elements.php +1 -1
- views/objects/addon_view_childparams.class.php +19 -4
inc_php/framework/functions.class.php
CHANGED
@@ -1535,6 +1535,26 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1535 |
|
1536 |
}
|
1537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1538 |
|
1539 |
/**
|
1540 |
* validate that the value is alphanumeric
|
1535 |
|
1536 |
}
|
1537 |
|
1538 |
+
/**
|
1539 |
+
* return if the array is id's array
|
1540 |
+
*/
|
1541 |
+
public static function isValidIDsArray($arr){
|
1542 |
+
|
1543 |
+
if(is_array($arr) == false)
|
1544 |
+
return(false);
|
1545 |
+
|
1546 |
+
if(empty($arr))
|
1547 |
+
return(true);
|
1548 |
+
|
1549 |
+
foreach($arr as $key=>$value){
|
1550 |
+
|
1551 |
+
if(is_numeric($key) == false || is_numeric($value) == false)
|
1552 |
+
return(false);
|
1553 |
+
}
|
1554 |
+
|
1555 |
+
return(true);
|
1556 |
+
}
|
1557 |
+
|
1558 |
|
1559 |
/**
|
1560 |
* validate that the value is alphanumeric
|
inc_php/unitecreator_dialog_param.class.php
CHANGED
@@ -27,6 +27,7 @@ class UniteCreatorDialogParamWork{
|
|
27 |
const PARAM_POSTS_LIST = "uc_posts_list";
|
28 |
const PARAM_POST_TERMS = "uc_post_terms";
|
29 |
const PARAM_WOO_CATS = "uc_woo_categories";
|
|
|
30 |
|
31 |
const PARAM_USERS = "uc_users";
|
32 |
const PARAM_TEMPLATE = "uc_template";
|
@@ -151,6 +152,7 @@ class UniteCreatorDialogParamWork{
|
|
151 |
$this->arrProParams[self::PARAM_BACKGROUND] = true;
|
152 |
$this->arrProParams[self::PARAM_BORDER] = true;
|
153 |
$this->arrProParams[self::PARAM_SLIDER] = true;
|
|
|
154 |
|
155 |
}
|
156 |
|
@@ -183,6 +185,8 @@ class UniteCreatorDialogParamWork{
|
|
183 |
$this->addParam(self::PARAM_POSTS_LIST, esc_html__("Posts List", "unlimited-elements-for-elementor"));
|
184 |
$this->addParam(self::PARAM_POST_TERMS, esc_html__("Posts Terms", "unlimited-elements-for-elementor"));
|
185 |
$this->addParam(self::PARAM_WOO_CATS, esc_html__("WooCommerce Categories", "unlimited-elements-for-elementor"));
|
|
|
|
|
186 |
$this->addParam(self::PARAM_USERS, esc_html__("Users List", "unlimited-elements-for-elementor"));
|
187 |
$this->addParam(self::PARAM_TEMPLATE, esc_html__("Elementor Template", "unlimited-elements-for-elementor"));
|
188 |
$this->addParam(self::PARAM_MENU, esc_html__("Menu", "unlimited-elements-for-elementor"));
|
@@ -727,8 +731,14 @@ class UniteCreatorDialogParamWork{
|
|
727 |
<?php
|
728 |
$this->putCheckbox("use_custom_fields", __("Use Custom Fields", "unlimited-elements-for-elementor"));
|
729 |
?>
|
|
|
|
|
|
|
|
|
|
|
730 |
|
731 |
<br><br>
|
|
|
732 |
<hr>
|
733 |
|
734 |
<?php
|
@@ -745,6 +755,15 @@ class UniteCreatorDialogParamWork{
|
|
745 |
|
746 |
}
|
747 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
|
749 |
/**
|
750 |
* put post list param
|
@@ -793,7 +812,17 @@ class UniteCreatorDialogParamWork{
|
|
793 |
$this->putCheckbox("show_image_sizes", __("Show Image Sizes Select", "unlimited-elements-for-elementor"));
|
794 |
?>
|
795 |
|
|
|
796 |
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
797 |
<?php
|
798 |
|
799 |
$this->putStyleCheckbox();
|
@@ -1199,6 +1228,9 @@ class UniteCreatorDialogParamWork{
|
|
1199 |
case self::PARAM_WOO_CATS:
|
1200 |
$this->putWooCatsParam();
|
1201 |
break;
|
|
|
|
|
|
|
1202 |
case self::PARAM_FORM:
|
1203 |
$this->putFormParam();
|
1204 |
break;
|
27 |
const PARAM_POSTS_LIST = "uc_posts_list";
|
28 |
const PARAM_POST_TERMS = "uc_post_terms";
|
29 |
const PARAM_WOO_CATS = "uc_woo_categories";
|
30 |
+
const PARAM_LISTING = "uc_listing";
|
31 |
|
32 |
const PARAM_USERS = "uc_users";
|
33 |
const PARAM_TEMPLATE = "uc_template";
|
152 |
$this->arrProParams[self::PARAM_BACKGROUND] = true;
|
153 |
$this->arrProParams[self::PARAM_BORDER] = true;
|
154 |
$this->arrProParams[self::PARAM_SLIDER] = true;
|
155 |
+
$this->arrProParams[self::PARAM_LISTING] = true;
|
156 |
|
157 |
}
|
158 |
|
185 |
$this->addParam(self::PARAM_POSTS_LIST, esc_html__("Posts List", "unlimited-elements-for-elementor"));
|
186 |
$this->addParam(self::PARAM_POST_TERMS, esc_html__("Posts Terms", "unlimited-elements-for-elementor"));
|
187 |
$this->addParam(self::PARAM_WOO_CATS, esc_html__("WooCommerce Categories", "unlimited-elements-for-elementor"));
|
188 |
+
$this->addParam(self::PARAM_LISTING, esc_html__("Listing", "unlimited-elements-for-elementor"));
|
189 |
+
|
190 |
$this->addParam(self::PARAM_USERS, esc_html__("Users List", "unlimited-elements-for-elementor"));
|
191 |
$this->addParam(self::PARAM_TEMPLATE, esc_html__("Elementor Template", "unlimited-elements-for-elementor"));
|
192 |
$this->addParam(self::PARAM_MENU, esc_html__("Menu", "unlimited-elements-for-elementor"));
|
731 |
<?php
|
732 |
$this->putCheckbox("use_custom_fields", __("Use Custom Fields", "unlimited-elements-for-elementor"));
|
733 |
?>
|
734 |
+
<div class="vert_sap20"></div>
|
735 |
+
|
736 |
+
<?php
|
737 |
+
$this->putCheckbox("for_woocommerce", __("For WooCommerce Terms", "unlimited-elements-for-elementor"));
|
738 |
+
?>
|
739 |
|
740 |
<br><br>
|
741 |
+
|
742 |
<hr>
|
743 |
|
744 |
<?php
|
755 |
|
756 |
}
|
757 |
|
758 |
+
/**
|
759 |
+
* put listing param
|
760 |
+
*/
|
761 |
+
private function putListingParam(){
|
762 |
+
|
763 |
+
esc_html_e("Put listing attributes here", "unlimited-elements-for-elementor");
|
764 |
+
|
765 |
+
}
|
766 |
+
|
767 |
|
768 |
/**
|
769 |
* put post list param
|
812 |
$this->putCheckbox("show_image_sizes", __("Show Image Sizes Select", "unlimited-elements-for-elementor"));
|
813 |
?>
|
814 |
|
815 |
+
<div class="vert_sap10"></div>
|
816 |
<hr>
|
817 |
+
<div class="vert_sap10"></div>
|
818 |
+
|
819 |
+
<?php
|
820 |
+
$this->putCheckbox("use_for_listing", __("Use For Listing Template", "unlimited-elements-for-elementor"));
|
821 |
+
?>
|
822 |
+
<div class="vert_sap10"></div>
|
823 |
+
<hr>
|
824 |
+
|
825 |
+
<div class="vert_sap10"></div>
|
826 |
<?php
|
827 |
|
828 |
$this->putStyleCheckbox();
|
1228 |
case self::PARAM_WOO_CATS:
|
1229 |
$this->putWooCatsParam();
|
1230 |
break;
|
1231 |
+
case self::PARAM_LISTING:
|
1232 |
+
$this->putListingParam();
|
1233 |
+
break;
|
1234 |
case self::PARAM_FORM:
|
1235 |
$this->putFormParam();
|
1236 |
break;
|
inc_php/unitecreator_output.class.php
CHANGED
@@ -1295,9 +1295,13 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1295 |
|
1296 |
$num = $index+1;
|
1297 |
|
1298 |
-
$
|
|
|
|
|
1299 |
|
1300 |
-
|
|
|
|
|
1301 |
|
1302 |
if($isShowMeta == false)
|
1303 |
continue;
|
1295 |
|
1296 |
$num = $index+1;
|
1297 |
|
1298 |
+
$post = get_post($id);
|
1299 |
+
$arrTermsNames = UniteFunctionsWPUC::getPostTermsTitles($post);
|
1300 |
+
$strTerms = implode(",", $arrTermsNames);
|
1301 |
|
1302 |
+
$text = "{$num}. <b>$title</b> (<i style='font-size:13px;'>$alias, $id | $strTerms </i>)";
|
1303 |
+
|
1304 |
+
dmp($text);
|
1305 |
|
1306 |
if($isShowMeta == false)
|
1307 |
continue;
|
inc_php/unitecreator_settings.class.php
CHANGED
@@ -218,7 +218,15 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
218 |
dmp("addPostsListPicker - function for override");
|
219 |
exit();
|
220 |
}
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
/**
|
224 |
* add post terms settings
|
@@ -484,6 +492,7 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
484 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
485 |
case UniteCreatorDialogParam::PARAM_USERS:
|
486 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
|
|
487 |
|
488 |
return(true);
|
489 |
break;
|
@@ -696,11 +705,22 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
696 |
$this->addPostsListPicker($name,$value,$title,$extra);
|
697 |
break;
|
698 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
|
|
|
|
|
|
699 |
$this->addPostTermsPicker($name,$value,$title,$extra);
|
700 |
break;
|
701 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
702 |
$this->addWooCatsPicker($name,$value,$title,$extra);
|
703 |
-
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
case UniteCreatorDialogParam::PARAM_USERS:
|
705 |
$this->addUsersPicker($name,$value,$title,$extra);
|
706 |
break;
|
218 |
dmp("addPostsListPicker - function for override");
|
219 |
exit();
|
220 |
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* add listing picker, function for override
|
224 |
+
*/
|
225 |
+
protected function addListingPicker($name,$value,$title,$extra){
|
226 |
+
|
227 |
+
dmp("addListingPicker - function for override");
|
228 |
+
exit();
|
229 |
+
}
|
230 |
|
231 |
/**
|
232 |
* add post terms settings
|
492 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
493 |
case UniteCreatorDialogParam::PARAM_USERS:
|
494 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
495 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
496 |
|
497 |
return(true);
|
498 |
break;
|
705 |
$this->addPostsListPicker($name,$value,$title,$extra);
|
706 |
break;
|
707 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
708 |
+
|
709 |
+
$extra["for_woocommerce"] = UniteFunctionsUC::getVal($param, "for_woocommerce");
|
710 |
+
|
711 |
$this->addPostTermsPicker($name,$value,$title,$extra);
|
712 |
break;
|
713 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
714 |
$this->addWooCatsPicker($name,$value,$title,$extra);
|
715 |
+
break;
|
716 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
717 |
+
|
718 |
+
$this->addListingPicker($name,$value,$title,$extra);
|
719 |
+
|
720 |
+
break;
|
721 |
+
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
722 |
+
$this->addWooCatsPicker($name,$value,$title,$extra);
|
723 |
+
break;
|
724 |
case UniteCreatorDialogParam::PARAM_USERS:
|
725 |
$this->addUsersPicker($name,$value,$title,$extra);
|
726 |
break;
|
inc_php/unitecreator_template_engine.class.php
CHANGED
@@ -489,21 +489,6 @@ class UniteCreatorTemplateEngineWork{
|
|
489 |
//function for override
|
490 |
}
|
491 |
|
492 |
-
/**
|
493 |
-
* put woo commerce filter
|
494 |
-
*/
|
495 |
-
public function putWooFilter($filterName = null){
|
496 |
-
|
497 |
-
if(empty($filterName))
|
498 |
-
UniteFunctionsUC::throwError("putWooFilter error: No Filter provided");
|
499 |
-
|
500 |
-
$isActive = UniteCreatorWooIntegrate::isWooActive();
|
501 |
-
|
502 |
-
$objWooIntegrate = UniteCreatorWooIntegrate::getInstance();
|
503 |
-
|
504 |
-
$objWooIntegrate->putHtmlFilter($filterName);
|
505 |
-
|
506 |
-
}
|
507 |
|
508 |
/**
|
509 |
* get woo child product
|
@@ -619,6 +604,52 @@ class UniteCreatorTemplateEngineWork{
|
|
619 |
$objPagination->putPaginationWidgetHtml($args);
|
620 |
}
|
621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
/**
|
623 |
* number format for woocommerce
|
624 |
*/
|
@@ -635,6 +666,20 @@ class UniteCreatorTemplateEngineWork{
|
|
635 |
|
636 |
return($price);
|
637 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
|
639 |
/**
|
640 |
* get listing item data
|
@@ -746,6 +791,7 @@ class UniteCreatorTemplateEngineWork{
|
|
746 |
$getPostTags = new Twig_SimpleFunction('getPostTags', array($this,"getPostTags"));
|
747 |
$getPostData = new Twig_SimpleFunction('getPostData', array($this,"getPostData"));
|
748 |
$putPagination = new Twig_SimpleFunction('putPagination', array($this,"putPagination"));
|
|
|
749 |
|
750 |
$putPostImageAttributes = new Twig_SimpleFunction('putPostImageAttributes', array($this,"putPostImageAttributes"));
|
751 |
|
@@ -760,9 +806,7 @@ class UniteCreatorTemplateEngineWork{
|
|
760 |
$getPostTerms = new Twig_SimpleFunction('getPostTerms', array($this,"getPostTerms"));
|
761 |
$getPostAuthor = new Twig_SimpleFunction('getPostAuthor', array($this,"getPostAuthor"));
|
762 |
$getUserData = new Twig_SimpleFunction('getUserData', array($this,"getUserData"));
|
763 |
-
$putWooFilter = new Twig_SimpleFunction('putWooFilter', array($this,"putWooFilter"));
|
764 |
$getWooChildProducts = new Twig_SimpleFunction('getWooChildProducts', array($this,"getWooChildProducts"));
|
765 |
-
|
766 |
$getListingItemData = new Twig_SimpleFunction('getListingItemData', array($this,"getListingItemData"));
|
767 |
|
768 |
$printTermCustomFields = new Twig_SimpleFunction('printTermCustomFields', array($this,"printTermCustomFields"));
|
@@ -773,7 +817,8 @@ class UniteCreatorTemplateEngineWork{
|
|
773 |
$filterWPAutop = new Twig_SimpleFilter("wpautop", array($this, "filterWPAutop"));
|
774 |
$filterUCDate = new Twig_SimpleFilter("ucdate", array($this, "filterUCDate"));
|
775 |
$filterPriceNumberFormat = new Twig_SimpleFilter("price_number_format", array($this, "filterPriceNumberFormat"));
|
776 |
-
|
|
|
777 |
$putTestHtml = new Twig_SimpleFunction('putTestHTML', array($this,"putTestHTML"));
|
778 |
|
779 |
|
@@ -808,11 +853,11 @@ class UniteCreatorTemplateEngineWork{
|
|
808 |
$this->twig->addFunction($printJsonVar);
|
809 |
$this->twig->addFunction($printJsonHtmlData);
|
810 |
$this->twig->addFunction($putPagination);
|
|
|
811 |
|
812 |
$this->twig->addFunction($getPostTerms);
|
813 |
$this->twig->addFunction($getPostAuthor);
|
814 |
$this->twig->addFunction($getUserData);
|
815 |
-
$this->twig->addFunction($putWooFilter);
|
816 |
$this->twig->addFunction($getWooChildProducts);
|
817 |
$this->twig->addFunction($getTermCustomFields);
|
818 |
$this->twig->addFunction($putItemsJsonFunction);
|
@@ -828,6 +873,7 @@ class UniteCreatorTemplateEngineWork{
|
|
828 |
$this->twig->addFilter($filterWPAutop);
|
829 |
$this->twig->addFilter($filterUCDate);
|
830 |
$this->twig->addFilter($filterPriceNumberFormat);
|
|
|
831 |
|
832 |
|
833 |
//pro functions
|
489 |
//function for override
|
490 |
}
|
491 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
|
493 |
/**
|
494 |
* get woo child product
|
604 |
$objPagination->putPaginationWidgetHtml($args);
|
605 |
}
|
606 |
|
607 |
+
|
608 |
+
/**
|
609 |
+
* put listing template
|
610 |
+
*/
|
611 |
+
/*
|
612 |
+
public function putListingTemplate_posts($paramName, $templateID){
|
613 |
+
|
614 |
+
global $wp_query;
|
615 |
+
|
616 |
+
$originalPost = $GLOBALS['post'];
|
617 |
+
|
618 |
+
//backup the original querified object
|
619 |
+
$originalQueriedObject = $wp_query->queried_object;
|
620 |
+
$originalQueriedObjectID = $wp_query->queried_object_id;
|
621 |
+
|
622 |
+
foreach($this->arrItems as $item){
|
623 |
+
|
624 |
+
$item = UniteFunctionsUC::getVal($item, "item");
|
625 |
+
|
626 |
+
$postItem = UniteFunctionsUC::getVal($item, $paramName);
|
627 |
+
if(empty($postItem))
|
628 |
+
UniteFunctionsUC::throwError("Posts List attribute: $paramName not found. please write the correct post list attribute name.");
|
629 |
+
|
630 |
+
$postID = $postItem->ID;
|
631 |
+
|
632 |
+
|
633 |
+
//set the post qieried object
|
634 |
+
$wp_query->queried_object = $postItem;
|
635 |
+
$wp_query->queried_object_id = $postID;
|
636 |
+
|
637 |
+
$GLOBALS['post'] = $postItem;
|
638 |
+
|
639 |
+
$output = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( 1753 );
|
640 |
+
|
641 |
+
echo $output;
|
642 |
+
}
|
643 |
+
|
644 |
+
//restore the original queried object
|
645 |
+
$wp_query->queried_object = $originalQueriedObject;
|
646 |
+
$wp_query->queried_object_id = $originalQueriedObjectID;
|
647 |
+
$GLOBALS['post'] = $originalPost;
|
648 |
+
|
649 |
+
}
|
650 |
+
|
651 |
+
*/
|
652 |
+
|
653 |
/**
|
654 |
* number format for woocommerce
|
655 |
*/
|
666 |
|
667 |
return($price);
|
668 |
}
|
669 |
+
|
670 |
+
/**
|
671 |
+
* number format for woocommerce
|
672 |
+
*/
|
673 |
+
public function filterWcPrice($price){
|
674 |
+
|
675 |
+
if(function_exists("wc_price") == false)
|
676 |
+
return($price);
|
677 |
+
|
678 |
+
$newPrice = wc_price($price);
|
679 |
+
|
680 |
+
return($newPrice);
|
681 |
+
}
|
682 |
+
|
683 |
|
684 |
/**
|
685 |
* get listing item data
|
791 |
$getPostTags = new Twig_SimpleFunction('getPostTags', array($this,"getPostTags"));
|
792 |
$getPostData = new Twig_SimpleFunction('getPostData', array($this,"getPostData"));
|
793 |
$putPagination = new Twig_SimpleFunction('putPagination', array($this,"putPagination"));
|
794 |
+
//$putListingTemplate_post = new Twig_SimpleFunction('putListingTemplate_posts', array($this,"putListingTemplate_posts"));
|
795 |
|
796 |
$putPostImageAttributes = new Twig_SimpleFunction('putPostImageAttributes', array($this,"putPostImageAttributes"));
|
797 |
|
806 |
$getPostTerms = new Twig_SimpleFunction('getPostTerms', array($this,"getPostTerms"));
|
807 |
$getPostAuthor = new Twig_SimpleFunction('getPostAuthor', array($this,"getPostAuthor"));
|
808 |
$getUserData = new Twig_SimpleFunction('getUserData', array($this,"getUserData"));
|
|
|
809 |
$getWooChildProducts = new Twig_SimpleFunction('getWooChildProducts', array($this,"getWooChildProducts"));
|
|
|
810 |
$getListingItemData = new Twig_SimpleFunction('getListingItemData', array($this,"getListingItemData"));
|
811 |
|
812 |
$printTermCustomFields = new Twig_SimpleFunction('printTermCustomFields', array($this,"printTermCustomFields"));
|
817 |
$filterWPAutop = new Twig_SimpleFilter("wpautop", array($this, "filterWPAutop"));
|
818 |
$filterUCDate = new Twig_SimpleFilter("ucdate", array($this, "filterUCDate"));
|
819 |
$filterPriceNumberFormat = new Twig_SimpleFilter("price_number_format", array($this, "filterPriceNumberFormat"));
|
820 |
+
$filterWcPrice = new Twig_SimpleFilter("wc_price", array($this, "filterWcPrice"));
|
821 |
+
|
822 |
$putTestHtml = new Twig_SimpleFunction('putTestHTML', array($this,"putTestHTML"));
|
823 |
|
824 |
|
853 |
$this->twig->addFunction($printJsonVar);
|
854 |
$this->twig->addFunction($printJsonHtmlData);
|
855 |
$this->twig->addFunction($putPagination);
|
856 |
+
//$this->twig->addFunction($putListingTemplate_post);
|
857 |
|
858 |
$this->twig->addFunction($getPostTerms);
|
859 |
$this->twig->addFunction($getPostAuthor);
|
860 |
$this->twig->addFunction($getUserData);
|
|
|
861 |
$this->twig->addFunction($getWooChildProducts);
|
862 |
$this->twig->addFunction($getTermCustomFields);
|
863 |
$this->twig->addFunction($putItemsJsonFunction);
|
873 |
$this->twig->addFilter($filterWPAutop);
|
874 |
$this->twig->addFilter($filterUCDate);
|
875 |
$this->twig->addFilter($filterPriceNumberFormat);
|
876 |
+
$this->twig->addFilter($filterWcPrice);
|
877 |
|
878 |
|
879 |
//pro functions
|
includes.php
CHANGED
@@ -12,7 +12,7 @@ if(!defined('UNLIMITED_ELEMENTS_INC'))
|
|
12 |
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
13 |
|
14 |
if(!defined("UNLIMITED_ELEMENTS_VERSION"))
|
15 |
-
define("UNLIMITED_ELEMENTS_VERSION", "1.4.
|
16 |
|
17 |
$currentFile = __FILE__;
|
18 |
$currentFolder = dirname($currentFile);
|
12 |
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
13 |
|
14 |
if(!defined("UNLIMITED_ELEMENTS_VERSION"))
|
15 |
+
define("UNLIMITED_ELEMENTS_VERSION", "1.4.71");
|
16 |
|
17 |
$currentFile = __FILE__;
|
18 |
$currentFolder = dirname($currentFile);
|
js/unitecreator_admin.js
CHANGED
@@ -573,7 +573,7 @@ function UniteCreatorAdmin(){
|
|
573 |
jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
|
574 |
|
575 |
var itemTabText = param["items_panel_text"];
|
576 |
-
|
577 |
jQuery(".uc-postsitems-related").remove();
|
578 |
jQuery("#uc_tab_itemattr").append("<div class='uc-postsitems-related'>"+itemTabText+"</div>");
|
579 |
|
@@ -637,6 +637,11 @@ function UniteCreatorAdmin(){
|
|
637 |
var param = arrParams[index];
|
638 |
|
639 |
switch(param.type){
|
|
|
|
|
|
|
|
|
|
|
640 |
case "uc_posts_list":
|
641 |
param["items_param_type"] = "uc_post";
|
642 |
param["items_panel_text"] = "Items as posts mode";
|
573 |
jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
|
574 |
|
575 |
var itemTabText = param["items_panel_text"];
|
576 |
+
|
577 |
jQuery(".uc-postsitems-related").remove();
|
578 |
jQuery("#uc_tab_itemattr").append("<div class='uc-postsitems-related'>"+itemTabText+"</div>");
|
579 |
|
637 |
var param = arrParams[index];
|
638 |
|
639 |
switch(param.type){
|
640 |
+
case "uc_listing":
|
641 |
+
param["items_param_type"] = "uc_listing";
|
642 |
+
param["items_panel_text"] = "Items as listing mode";
|
643 |
+
return(param);
|
644 |
+
break;
|
645 |
case "uc_posts_list":
|
646 |
param["items_param_type"] = "uc_post";
|
647 |
param["items_panel_text"] = "Items as posts mode";
|
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js
CHANGED
@@ -179,6 +179,8 @@ function UniteCreatorElementorEditorAdmin(){
|
|
179 |
var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
|
180 |
if(isCurrentTaxRelevant == false && firstVisibleOption){
|
181 |
|
|
|
|
|
182 |
selectPostTaxonomy.val(firstVisibleOption).trigger("change");
|
183 |
}
|
184 |
|
@@ -227,9 +229,15 @@ function UniteCreatorElementorEditorAdmin(){
|
|
227 |
placeholder:placeholder
|
228 |
});
|
229 |
|
230 |
-
if(jQuery.isEmptyObject(selectedCatID) == false)
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
|
235 |
/**
|
@@ -568,6 +576,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
568 |
arrInitIDs.push(item.id);
|
569 |
}
|
570 |
|
|
|
571 |
objSelect.val(arrInitIDs).trigger("change");
|
572 |
|
573 |
}
|
@@ -576,7 +585,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
576 |
* init post id's selector
|
577 |
*/
|
578 |
function initPostIDsSelect(objSelect){
|
579 |
-
|
580 |
var widgetSettings = getLastOpenedWidgetSettings();
|
581 |
|
582 |
var settingName = objSelect.data("setting");
|
179 |
var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
|
180 |
if(isCurrentTaxRelevant == false && firstVisibleOption){
|
181 |
|
182 |
+
trace("trigger 1");
|
183 |
+
|
184 |
selectPostTaxonomy.val(firstVisibleOption).trigger("change");
|
185 |
}
|
186 |
|
229 |
placeholder:placeholder
|
230 |
});
|
231 |
|
232 |
+
if(jQuery.isEmptyObject(selectedCatID) == false){
|
233 |
+
|
234 |
+
objSelectPostCategory.val(selectedCatID);
|
235 |
+
|
236 |
+
//var newSelectedCatID = objSelectPostCategory.select2("val");
|
237 |
+
|
238 |
+
objSelectPostCategory.trigger("change");
|
239 |
+
|
240 |
+
}
|
241 |
}
|
242 |
|
243 |
/**
|
576 |
arrInitIDs.push(item.id);
|
577 |
}
|
578 |
|
579 |
+
trace("trigger 3");
|
580 |
objSelect.val(arrInitIDs).trigger("change");
|
581 |
|
582 |
}
|
585 |
* init post id's selector
|
586 |
*/
|
587 |
function initPostIDsSelect(objSelect){
|
588 |
+
|
589 |
var widgetSettings = getLastOpenedWidgetSettings();
|
590 |
|
591 |
var settingName = objSelect.data("setting");
|
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php
CHANGED
@@ -1376,11 +1376,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1376 |
case UniteCreatorDialogParam::PARAM_USERS:
|
1377 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
1378 |
case UniteCreatorDialogParam::PARAM_MENU:
|
|
|
1379 |
|
1380 |
$settings = new UniteCreatorSettings();
|
1381 |
|
1382 |
$arrChildParams = $settings->getMultipleCreatorParams($param);
|
1383 |
-
|
1384 |
foreach($arrChildParams as $childParam)
|
1385 |
$this->addElementorParamUC($childParam,$objControls);
|
1386 |
|
@@ -1389,9 +1390,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1389 |
|
1390 |
$param["all_cats_mode"] = true;
|
1391 |
|
1392 |
-
//add current posts settings
|
1393 |
-
$isArchiveLocation = UniteFunctionsWPUC::isArchiveLocation();
|
1394 |
-
|
1395 |
$param["add_current_posts"] = true;
|
1396 |
|
1397 |
$settings = new UniteCreatorSettings();
|
@@ -1769,6 +1768,17 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1769 |
return($arrOutput);
|
1770 |
}
|
1771 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1772 |
|
1773 |
/**
|
1774 |
* register controls with not consolidated addon
|
@@ -1807,7 +1817,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1807 |
$hasPostsList = false;
|
1808 |
$postListParam = null;
|
1809 |
|
1810 |
-
|
|
|
|
|
1811 |
//foreach the categories
|
1812 |
foreach($arrCatsAndParams as $catID => $arrCat){
|
1813 |
|
@@ -1852,10 +1864,15 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1852 |
|
1853 |
if($showImageSizes == true)
|
1854 |
$this->addImageSizesControl($postListParam, $this->objControls);
|
1855 |
-
|
1856 |
continue;
|
1857 |
}
|
1858 |
|
|
|
|
|
|
|
|
|
|
|
1859 |
$this->addElementorParamUC($param);
|
1860 |
}
|
1861 |
|
@@ -1879,12 +1896,16 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1879 |
'label' => $labelPosts,
|
1880 |
)
|
1881 |
);
|
1882 |
-
|
1883 |
$this->addElementorParamUC($postListParam);
|
1884 |
|
1885 |
$this->end_controls_section();
|
1886 |
}
|
1887 |
-
|
|
|
|
|
|
|
|
|
1888 |
//add no attributes section
|
1889 |
if($isNoSettings == true){
|
1890 |
|
@@ -2712,9 +2733,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2712 |
return("");
|
2713 |
|
2714 |
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
2715 |
-
|
2716 |
-
//validate post source, enable only on current
|
2717 |
|
|
|
2718 |
if($isArchivePage == true){
|
2719 |
|
2720 |
$postListName = UniteFunctionsUC::getVal($arrPostListParam, "name");
|
1376 |
case UniteCreatorDialogParam::PARAM_USERS:
|
1377 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
1378 |
case UniteCreatorDialogParam::PARAM_MENU:
|
1379 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
1380 |
|
1381 |
$settings = new UniteCreatorSettings();
|
1382 |
|
1383 |
$arrChildParams = $settings->getMultipleCreatorParams($param);
|
1384 |
+
|
1385 |
foreach($arrChildParams as $childParam)
|
1386 |
$this->addElementorParamUC($childParam,$objControls);
|
1387 |
|
1390 |
|
1391 |
$param["all_cats_mode"] = true;
|
1392 |
|
1393 |
+
//add current posts settings
|
|
|
|
|
1394 |
$param["add_current_posts"] = true;
|
1395 |
|
1396 |
$settings = new UniteCreatorSettings();
|
1768 |
return($arrOutput);
|
1769 |
}
|
1770 |
|
1771 |
+
/**
|
1772 |
+
* put listing sections
|
1773 |
+
*/
|
1774 |
+
private function putListingSections($listingParam){
|
1775 |
+
|
1776 |
+
if(GlobalsUC::$inDev == false)
|
1777 |
+
return(false);
|
1778 |
+
|
1779 |
+
//dmP("put listing sections");exit();
|
1780 |
+
|
1781 |
+
}
|
1782 |
|
1783 |
/**
|
1784 |
* register controls with not consolidated addon
|
1817 |
$hasPostsList = false;
|
1818 |
$postListParam = null;
|
1819 |
|
1820 |
+
$hasListing = false;
|
1821 |
+
$listingParam = null;
|
1822 |
+
|
1823 |
//foreach the categories
|
1824 |
foreach($arrCatsAndParams as $catID => $arrCat){
|
1825 |
|
1864 |
|
1865 |
if($showImageSizes == true)
|
1866 |
$this->addImageSizesControl($postListParam, $this->objControls);
|
1867 |
+
|
1868 |
continue;
|
1869 |
}
|
1870 |
|
1871 |
+
if($type == UniteCreatorDialogParam::PARAM_LISTING){
|
1872 |
+
$hasListing = true;
|
1873 |
+
$listingParam = $param;
|
1874 |
+
}
|
1875 |
+
|
1876 |
$this->addElementorParamUC($param);
|
1877 |
}
|
1878 |
|
1896 |
'label' => $labelPosts,
|
1897 |
)
|
1898 |
);
|
1899 |
+
|
1900 |
$this->addElementorParamUC($postListParam);
|
1901 |
|
1902 |
$this->end_controls_section();
|
1903 |
}
|
1904 |
+
|
1905 |
+
if($hasListing == true)
|
1906 |
+
$this->putListingSections($listingParam);
|
1907 |
+
|
1908 |
+
|
1909 |
//add no attributes section
|
1910 |
if($isNoSettings == true){
|
1911 |
|
2733 |
return("");
|
2734 |
|
2735 |
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
|
|
|
|
2736 |
|
2737 |
+
//validate post source, enable only on current
|
2738 |
if($isArchivePage == true){
|
2739 |
|
2740 |
$postListName = UniteFunctionsUC::getVal($arrPostListParam, "name");
|
provider/core/plugins/unlimited_elements/elementor/pagination.class.php
CHANGED
@@ -393,6 +393,7 @@ class UniteCreatorElementorPagination{
|
|
393 |
*/
|
394 |
public function putPaginationWidgetHtml($args){
|
395 |
|
|
|
396 |
$putPrevNext = UniteFunctionsUC::getVal($args, "put_prev_next_buttons");
|
397 |
$putPrevNext = UniteFunctionsUC::strToBool($putPrevNext);
|
398 |
|
@@ -443,14 +444,15 @@ class UniteCreatorElementorPagination{
|
|
443 |
//$options["current"] = 3;
|
444 |
|
445 |
//-------- put pagination html
|
446 |
-
|
447 |
-
$isArchivePage =
|
|
|
448 |
if($isArchivePage == true){
|
449 |
|
450 |
$options = $this->getArchivePageOptions($options);
|
451 |
-
|
452 |
$pagination = get_the_posts_pagination($options);
|
453 |
-
|
|
|
454 |
|
455 |
//skip for home pages
|
456 |
if(is_home() == true)
|
393 |
*/
|
394 |
public function putPaginationWidgetHtml($args){
|
395 |
|
396 |
+
|
397 |
$putPrevNext = UniteFunctionsUC::getVal($args, "put_prev_next_buttons");
|
398 |
$putPrevNext = UniteFunctionsUC::strToBool($putPrevNext);
|
399 |
|
444 |
//$options["current"] = 3;
|
445 |
|
446 |
//-------- put pagination html
|
447 |
+
|
448 |
+
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
449 |
+
|
450 |
if($isArchivePage == true){
|
451 |
|
452 |
$options = $this->getArchivePageOptions($options);
|
|
|
453 |
$pagination = get_the_posts_pagination($options);
|
454 |
+
|
455 |
+
}else{ //on single
|
456 |
|
457 |
//skip for home pages
|
458 |
if(is_home() == true)
|
provider/functions_wordpress.class.php
CHANGED
@@ -602,9 +602,37 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
602 |
|
603 |
|
604 |
return($arrDataOutput);
|
605 |
-
|
606 |
}
|
607 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
608 |
|
609 |
|
610 |
/**
|
@@ -1161,7 +1189,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1161 |
/**
|
1162 |
* get post meta data
|
1163 |
*/
|
1164 |
-
public static function getPostMetaKeys($postID, $prefix = null){
|
1165 |
|
1166 |
$postMeta = get_post_meta($postID);
|
1167 |
|
@@ -1175,7 +1203,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1175 |
|
1176 |
$firstSign = $key[0];
|
1177 |
|
1178 |
-
if($firstSign == "_")
|
1179 |
continue;
|
1180 |
|
1181 |
if(!empty($prefix))
|
@@ -1381,7 +1409,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1381 |
else
|
1382 |
$arrCategories = explode(",", $category);
|
1383 |
|
1384 |
-
|
1385 |
foreach($arrCategories as $cat){
|
1386 |
|
1387 |
//check for empty category - mean all categories
|
@@ -1412,10 +1439,10 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1412 |
if($isExclude == true){
|
1413 |
$arrSearchItem["operator"] = "NOT IN";
|
1414 |
}
|
1415 |
-
|
1416 |
$arrQuery[] = $arrSearchItem;
|
1417 |
}
|
1418 |
-
|
1419 |
return($arrQuery);
|
1420 |
}
|
1421 |
|
@@ -1430,15 +1457,38 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1430 |
if($category == "all" && empty($excludeCategory))
|
1431 |
return(null);
|
1432 |
|
|
|
1433 |
//get the query
|
1434 |
$arrQuery = array();
|
|
|
1435 |
|
1436 |
if(!empty($category))
|
1437 |
$arrQuery = self::getPosts_getTaxQuery_getArrQuery($arrQuery, $category, $categoryRelation, $isIncludeChildren, false);
|
1438 |
|
|
|
|
|
1439 |
if(!empty($excludeCategory))
|
1440 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
|
|
|
1442 |
if(empty($arrQuery))
|
1443 |
return(null);
|
1444 |
|
@@ -1446,7 +1496,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1446 |
return($arrQuery);
|
1447 |
|
1448 |
//check and add relation
|
1449 |
-
if($categoryRelation === "OR" &&
|
1450 |
$arrQuery["relation"] = "OR";
|
1451 |
|
1452 |
return($arrQuery);
|
@@ -1491,7 +1541,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1491 |
|
1492 |
$categoryExcludeChildren = UniteFunctionsUC::getVal($filters, "category_exclude_children");
|
1493 |
$categoryExcludeChildren = UniteFunctionsUC::strToBool($categoryExcludeChildren);
|
1494 |
-
|
1495 |
$arrTax = self::getPosts_getTaxQuery($category, $categoryRelation, $categoryIncludeChildren, $excludeCategory, $categoryExcludeChildren);
|
1496 |
|
1497 |
$search = UniteFunctionsUC::getVal($filters, "search");
|
@@ -2598,6 +2648,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2598 |
*/
|
2599 |
public static function isArchiveLocation(){
|
2600 |
|
|
|
|
|
|
|
2601 |
if(( is_archive() || is_tax() || is_home() || is_search() ))
|
2602 |
return(true);
|
2603 |
|
602 |
|
603 |
|
604 |
return($arrDataOutput);
|
|
|
605 |
}
|
606 |
|
607 |
+
/**
|
608 |
+
* get post terms titles
|
609 |
+
*/
|
610 |
+
public static function getPostTermsTitles($post){
|
611 |
+
|
612 |
+
$arrTermsWithTax = self::getPostTerms($post);
|
613 |
+
|
614 |
+
if(empty($arrTermsWithTax))
|
615 |
+
return(array());
|
616 |
+
|
617 |
+
$arrTitles = array();
|
618 |
+
|
619 |
+
foreach($arrTermsWithTax as $taxanomy=>$arrTerms){
|
620 |
+
|
621 |
+
if(empty($arrTerms))
|
622 |
+
continue;
|
623 |
+
|
624 |
+
foreach($arrTerms as $term){
|
625 |
+
|
626 |
+
$name = UniteFunctionsUC::getVal($term, "name");
|
627 |
+
if(empty($name))
|
628 |
+
continue;
|
629 |
+
|
630 |
+
$arrTitles[] = $name;
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
return($arrTitles);
|
635 |
+
}
|
636 |
|
637 |
|
638 |
/**
|
1189 |
/**
|
1190 |
* get post meta data
|
1191 |
*/
|
1192 |
+
public static function getPostMetaKeys($postID, $prefix = null, $includeUnderscore = false){
|
1193 |
|
1194 |
$postMeta = get_post_meta($postID);
|
1195 |
|
1203 |
|
1204 |
$firstSign = $key[0];
|
1205 |
|
1206 |
+
if($firstSign == "_" && $includeUnderscore == false)
|
1207 |
continue;
|
1208 |
|
1209 |
if(!empty($prefix))
|
1409 |
else
|
1410 |
$arrCategories = explode(",", $category);
|
1411 |
|
|
|
1412 |
foreach($arrCategories as $cat){
|
1413 |
|
1414 |
//check for empty category - mean all categories
|
1439 |
if($isExclude == true){
|
1440 |
$arrSearchItem["operator"] = "NOT IN";
|
1441 |
}
|
1442 |
+
|
1443 |
$arrQuery[] = $arrSearchItem;
|
1444 |
}
|
1445 |
+
|
1446 |
return($arrQuery);
|
1447 |
}
|
1448 |
|
1457 |
if($category == "all" && empty($excludeCategory))
|
1458 |
return(null);
|
1459 |
|
1460 |
+
|
1461 |
//get the query
|
1462 |
$arrQuery = array();
|
1463 |
+
$arrQueryExclude = array();
|
1464 |
|
1465 |
if(!empty($category))
|
1466 |
$arrQuery = self::getPosts_getTaxQuery_getArrQuery($arrQuery, $category, $categoryRelation, $isIncludeChildren, false);
|
1467 |
|
1468 |
+
$numQueryItems = count($arrQuery);
|
1469 |
+
|
1470 |
if(!empty($excludeCategory))
|
1471 |
+
$arrQueryExclude = self::getPosts_getTaxQuery_getArrQuery($arrQueryExclude, $excludeCategory, $categoryRelation, $isExcludeChildren, true);
|
1472 |
+
|
1473 |
+
//make nested - if both filled
|
1474 |
+
if(!empty($arrQueryExclude) && !empty($arrQuery) && $numQueryItems > 1 && $categoryRelation === "OR"){
|
1475 |
+
|
1476 |
+
//check and add relation
|
1477 |
+
$arrQuery["relation"] = "OR";
|
1478 |
+
|
1479 |
+
$arrQueryCombined = array();
|
1480 |
+
$arrQueryCombined[] = $arrQuery;
|
1481 |
+
$arrQueryCombined[] = $arrQueryExclude;
|
1482 |
+
|
1483 |
+
return($arrQueryCombined);
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
|
1487 |
+
//in case there is exclude only
|
1488 |
+
if(!empty($arrQueryExclude))
|
1489 |
+
$arrQuery = array_merge($arrQuery, $arrQueryExclude);
|
1490 |
|
1491 |
+
//for single query
|
1492 |
if(empty($arrQuery))
|
1493 |
return(null);
|
1494 |
|
1496 |
return($arrQuery);
|
1497 |
|
1498 |
//check and add relation
|
1499 |
+
if($categoryRelation === "OR" && $numQueryItems > 1)
|
1500 |
$arrQuery["relation"] = "OR";
|
1501 |
|
1502 |
return($arrQuery);
|
1541 |
|
1542 |
$categoryExcludeChildren = UniteFunctionsUC::getVal($filters, "category_exclude_children");
|
1543 |
$categoryExcludeChildren = UniteFunctionsUC::strToBool($categoryExcludeChildren);
|
1544 |
+
|
1545 |
$arrTax = self::getPosts_getTaxQuery($category, $categoryRelation, $categoryIncludeChildren, $excludeCategory, $categoryExcludeChildren);
|
1546 |
|
1547 |
$search = UniteFunctionsUC::getVal($filters, "search");
|
2648 |
*/
|
2649 |
public static function isArchiveLocation(){
|
2650 |
|
2651 |
+
if(is_single())
|
2652 |
+
return(false);
|
2653 |
+
|
2654 |
if(( is_archive() || is_tax() || is_home() || is_search() ))
|
2655 |
return(true);
|
2656 |
|
provider/provider_dialog_param.class.php
CHANGED
@@ -43,6 +43,10 @@ class UniteCreatorDialogParam extends UniteCreatorDialogParamWork{
|
|
43 |
$this->arrParams[] = self::PARAM_WOO_CATS;
|
44 |
$this->arrParams[] = self::PARAM_USERS;
|
45 |
$this->arrParams[] = self::PARAM_TEMPLATE;
|
|
|
|
|
|
|
|
|
46 |
$this->arrParams[] = self::PARAM_TYPOGRAPHY;
|
47 |
$this->arrParams[] = self::PARAM_MARGINS;
|
48 |
$this->arrParams[] = self::PARAM_PADDING;
|
@@ -55,7 +59,7 @@ class UniteCreatorDialogParam extends UniteCreatorDialogParamWork{
|
|
55 |
$this->arrParams[] = self::PARAM_BORDER_DIMENTIONS;
|
56 |
$this->arrParams[] = self::PARAM_CSS_FILTERS;
|
57 |
$this->arrParams[] = self::PARAM_HOVER_ANIMATIONS;
|
58 |
-
|
59 |
$this->arrParams = $this->filterMainParams($this->arrParams);
|
60 |
}
|
61 |
|
43 |
$this->arrParams[] = self::PARAM_WOO_CATS;
|
44 |
$this->arrParams[] = self::PARAM_USERS;
|
45 |
$this->arrParams[] = self::PARAM_TEMPLATE;
|
46 |
+
|
47 |
+
if(GlobalsUC::$inDev == true)
|
48 |
+
$this->arrParams[] = self::PARAM_LISTING;
|
49 |
+
|
50 |
$this->arrParams[] = self::PARAM_TYPOGRAPHY;
|
51 |
$this->arrParams[] = self::PARAM_MARGINS;
|
52 |
$this->arrParams[] = self::PARAM_PADDING;
|
59 |
$this->arrParams[] = self::PARAM_BORDER_DIMENTIONS;
|
60 |
$this->arrParams[] = self::PARAM_CSS_FILTERS;
|
61 |
$this->arrParams[] = self::PARAM_HOVER_ANIMATIONS;
|
62 |
+
|
63 |
$this->arrParams = $this->filterMainParams($this->arrParams);
|
64 |
}
|
65 |
|
provider/provider_params_processor.class.php
CHANGED
@@ -243,6 +243,155 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
243 |
|
244 |
protected function z_______________POSTS____________(){}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
|
247 |
/**
|
248 |
* get post category taxonomy
|
@@ -914,6 +1063,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
914 |
$arrIDsOnSale = array();
|
915 |
$arrRecentProducts = array();
|
916 |
$arrIDsPopular = array();
|
|
|
|
|
|
|
|
|
917 |
|
918 |
foreach($arrIncludeBy as $includeby){
|
919 |
|
@@ -1056,6 +1209,16 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1056 |
}
|
1057 |
|
1058 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
}
|
1060 |
|
1061 |
}
|
@@ -1072,6 +1235,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1072 |
}
|
1073 |
|
1074 |
if(!empty($arrIDsPopular)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1075 |
|
1076 |
//set order
|
1077 |
$args["orderby"] = "post__in";
|
@@ -1080,10 +1260,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1080 |
if($orderDir == "ASC")
|
1081 |
$arrIDsPopular = array_reverse($arrIDsPopular);
|
1082 |
|
1083 |
-
unset($args["order"]);
|
1084 |
-
|
1085 |
-
$arrPostInIDs = $arrIDsPopular;
|
1086 |
}
|
|
|
1087 |
|
1088 |
if(!empty($arrPostInIDs))
|
1089 |
$args["post__in"] = $arrPostInIDs;
|
@@ -1388,7 +1567,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1388 |
$source = UniteFunctionsUC::getVal($value, "{$name}_source");
|
1389 |
|
1390 |
$arrPosts = array();
|
1391 |
-
|
1392 |
switch($source){
|
1393 |
case "manual":
|
1394 |
|
@@ -1439,13 +1618,22 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1439 |
$arrImageSizes["desktop"] = $imageSize;
|
1440 |
}
|
1441 |
|
|
|
1442 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1443 |
$arrData = array();
|
1444 |
foreach($arrPosts as $post){
|
1445 |
|
1446 |
$arrData[] = $this->getPostDataByObj($post, $arrPostAdditions, $arrImageSizes);
|
1447 |
}
|
1448 |
-
|
1449 |
|
1450 |
return($arrData);
|
1451 |
}
|
243 |
|
244 |
protected function z_______________POSTS____________(){}
|
245 |
|
246 |
+
/**
|
247 |
+
* get post ids from post meta
|
248 |
+
*/
|
249 |
+
private function getPostListData_getIDsFromPostMeta($value, $name, $showDebugQuery){
|
250 |
+
|
251 |
+
$postIDs = UniteFunctionsUC::getVal($value, $name."_includeby_postmeta_postid");
|
252 |
+
|
253 |
+
$metaName = UniteFunctionsUC::getVal($value, $name."_includeby_postmeta_metafield");
|
254 |
+
|
255 |
+
$errorMessagePrefix = "Get post ids from meta error: ";
|
256 |
+
|
257 |
+
if(empty($metaName)){
|
258 |
+
|
259 |
+
if($showDebugQuery == true)
|
260 |
+
dmp($errorMessagePrefix." no meta field selected");
|
261 |
+
|
262 |
+
return(null);
|
263 |
+
}
|
264 |
+
|
265 |
+
if(!empty($postIDs)){
|
266 |
+
if(is_array($postIDs))
|
267 |
+
$postID = $postIDs[0];
|
268 |
+
else
|
269 |
+
$postID = $postIDs;
|
270 |
+
}
|
271 |
+
else{ //current post
|
272 |
+
|
273 |
+
$post = get_post();
|
274 |
+
if(empty($post)){
|
275 |
+
|
276 |
+
if($showDebugQuery == true)
|
277 |
+
dmp($errorMessagePrefix." no post found");
|
278 |
+
return(null);
|
279 |
+
}
|
280 |
+
|
281 |
+
$postID = $post->ID;
|
282 |
+
}
|
283 |
+
|
284 |
+
if(empty($postID)){
|
285 |
+
|
286 |
+
if($showDebugQuery == true)
|
287 |
+
dmp($errorMessagePrefix." no post found");
|
288 |
+
|
289 |
+
return(null);
|
290 |
+
}
|
291 |
+
|
292 |
+
//show the post title
|
293 |
+
if($showDebugQuery == true){
|
294 |
+
|
295 |
+
$post = get_post($postID);
|
296 |
+
$title = $post->post_title;
|
297 |
+
$postType = $post->post_type;
|
298 |
+
|
299 |
+
dmp("Getting post id's from meta fields from post: <b>$postID - $title ($postType) </b>");
|
300 |
+
}
|
301 |
+
|
302 |
+
$arrPostIDs = get_post_meta($postID, $metaName, true);
|
303 |
+
|
304 |
+
if(is_array($arrPostIDs) == false){
|
305 |
+
$arrPostIDs = explode(",", $arrPostIDs);
|
306 |
+
}
|
307 |
+
|
308 |
+
$isValidIDs = UniteFunctionsUC::isValidIDsArray($arrPostIDs);
|
309 |
+
|
310 |
+
if(empty($arrPostIDs) || $isValidIDs == false){
|
311 |
+
|
312 |
+
if($showDebugQuery){
|
313 |
+
|
314 |
+
$metaKeys = UniteFunctionsWPUC::getPostMetaKeys($postID, null, true);
|
315 |
+
if(empty($metaKeys))
|
316 |
+
$metaKeys = array();
|
317 |
+
|
318 |
+
dmp($errorMessagePrefix." no post ids found");
|
319 |
+
|
320 |
+
if(array_search($metaName, $metaKeys) === false){
|
321 |
+
dmp("maybe you intent to use one of those meta keys:");
|
322 |
+
dmp($metaKeys);
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
return(null);
|
327 |
+
}
|
328 |
+
|
329 |
+
if($showDebugQuery == true){
|
330 |
+
$strPosts = implode(",", $arrPostIDs);
|
331 |
+
dmp("Found post ids : $strPosts");
|
332 |
+
}
|
333 |
+
|
334 |
+
return($arrPostIDs);
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
/**
|
339 |
+
* get post ids from php function
|
340 |
+
*/
|
341 |
+
private function getPostListData_getIDsFromPHPFunction($value, $name, $showDebugQuery){
|
342 |
+
|
343 |
+
$functionName = UniteFunctionsUC::getVal($value, $name."_includeby_function_name");
|
344 |
+
|
345 |
+
$errorTextPrefix = "get post id's by PHP Function error: ";
|
346 |
+
|
347 |
+
if(empty($functionName)){
|
348 |
+
|
349 |
+
if($showDebugQuery)
|
350 |
+
dmp($errorTextPrefix."no functon name given");
|
351 |
+
|
352 |
+
return(null);
|
353 |
+
}
|
354 |
+
|
355 |
+
if(is_string($functionName) == false)
|
356 |
+
return(false);
|
357 |
+
|
358 |
+
if(strpos($functionName, "get") !== 0){
|
359 |
+
|
360 |
+
if($showDebugQuery)
|
361 |
+
dmp($errorTextPrefix."function <b>$functionName</b> should start with 'get'. like getMyPersonalPosts()");
|
362 |
+
|
363 |
+
return(null);
|
364 |
+
}
|
365 |
+
|
366 |
+
if(function_exists($functionName) == false){
|
367 |
+
|
368 |
+
if($showDebugQuery)
|
369 |
+
dmp($errorTextPrefix."function <b>$functionName</b> not exists.");
|
370 |
+
|
371 |
+
return(null);
|
372 |
+
}
|
373 |
+
|
374 |
+
$argument = UniteFunctionsUC::getVal($value, $name."_includeby_function_addparam");
|
375 |
+
|
376 |
+
$arrIDs = call_user_func_array($functionName, array($argument));
|
377 |
+
|
378 |
+
$isValid = UniteFunctionsUC::isValidIDsArray($arrIDs);
|
379 |
+
|
380 |
+
if($isValid == false){
|
381 |
+
|
382 |
+
if($showDebugQuery)
|
383 |
+
dmp($errorTextPrefix."function <b>$functionName</b> returns invalid id's array.");
|
384 |
+
|
385 |
+
return(null);
|
386 |
+
}
|
387 |
+
|
388 |
+
if($showDebugQuery == true){
|
389 |
+
dmp("php function <b>$functionName(\"$argument\")</b> output: ");
|
390 |
+
dmp($arrIDs);
|
391 |
+
}
|
392 |
+
|
393 |
+
return($arrIDs);
|
394 |
+
}
|
395 |
|
396 |
/**
|
397 |
* get post category taxonomy
|
1063 |
$arrIDsOnSale = array();
|
1064 |
$arrRecentProducts = array();
|
1065 |
$arrIDsPopular = array();
|
1066 |
+
$arrIDsPHPFunction = array();
|
1067 |
+
$arrIDsPostMeta = array();
|
1068 |
+
|
1069 |
+
$makePostINOrder = false;
|
1070 |
|
1071 |
foreach($arrIncludeBy as $includeby){
|
1072 |
|
1209 |
}
|
1210 |
|
1211 |
break;
|
1212 |
+
case "php_function":
|
1213 |
+
|
1214 |
+
$arrIDsPHPFunction = $this->getPostListData_getIDsFromPHPFunction($value, $name, $showDebugQuery);
|
1215 |
+
|
1216 |
+
break;
|
1217 |
+
case "ids_from_meta":
|
1218 |
+
|
1219 |
+
$arrIDsPostMeta = $this->getPostListData_getIDsFromPostMeta($value, $name, $showDebugQuery);
|
1220 |
+
|
1221 |
+
break;
|
1222 |
}
|
1223 |
|
1224 |
}
|
1235 |
}
|
1236 |
|
1237 |
if(!empty($arrIDsPopular)){
|
1238 |
+
$makePostINOrder = true;
|
1239 |
+
$arrPostInIDs = $arrIDsPopular;
|
1240 |
+
}
|
1241 |
+
|
1242 |
+
if(!empty($arrIDsPHPFunction)){
|
1243 |
+
$arrPostInIDs = $arrIDsPHPFunction;
|
1244 |
+
$makePostINOrder = true;
|
1245 |
+
}
|
1246 |
+
|
1247 |
+
if(!empty($arrIDsPostMeta)){
|
1248 |
+
$arrPostInIDs = $arrIDsPostMeta;
|
1249 |
+
$makePostINOrder = true;
|
1250 |
+
}
|
1251 |
+
|
1252 |
+
//make order as "post__id"
|
1253 |
+
|
1254 |
+
if($makePostINOrder == true){
|
1255 |
|
1256 |
//set order
|
1257 |
$args["orderby"] = "post__in";
|
1260 |
if($orderDir == "ASC")
|
1261 |
$arrIDsPopular = array_reverse($arrIDsPopular);
|
1262 |
|
1263 |
+
unset($args["order"]);
|
|
|
|
|
1264 |
}
|
1265 |
+
|
1266 |
|
1267 |
if(!empty($arrPostInIDs))
|
1268 |
$args["post__in"] = $arrPostInIDs;
|
1567 |
$source = UniteFunctionsUC::getVal($value, "{$name}_source");
|
1568 |
|
1569 |
$arrPosts = array();
|
1570 |
+
|
1571 |
switch($source){
|
1572 |
case "manual":
|
1573 |
|
1618 |
$arrImageSizes["desktop"] = $imageSize;
|
1619 |
}
|
1620 |
|
1621 |
+
//prepare listing output. no items prepare for the listing
|
1622 |
|
1623 |
+
$useForListing = UniteFunctionsUC::getVal($param, "use_for_listing");
|
1624 |
+
$useForListing = UniteFunctionsUC::strToBool($useForListing);
|
1625 |
+
|
1626 |
+
if($useForListing == true){
|
1627 |
+
$arrData = $arrPosts;
|
1628 |
+
return($arrData);
|
1629 |
+
}
|
1630 |
+
|
1631 |
$arrData = array();
|
1632 |
foreach($arrPosts as $post){
|
1633 |
|
1634 |
$arrData[] = $this->getPostDataByObj($post, $arrPostAdditions, $arrImageSizes);
|
1635 |
}
|
1636 |
+
|
1637 |
|
1638 |
return($arrData);
|
1639 |
}
|
provider/provider_settings.class.php
CHANGED
@@ -363,8 +363,15 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
363 |
*/
|
364 |
protected function addPostTermsPicker($name, $value, $title, $extra){
|
365 |
|
|
|
|
|
|
|
|
|
366 |
$arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
|
367 |
|
|
|
|
|
|
|
368 |
$taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
|
369 |
|
370 |
$arrPostTypesTaxonomies = $taxData["post_type_tax"];
|
@@ -408,14 +415,17 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
408 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
409 |
|
410 |
$arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
|
411 |
-
|
412 |
if(!empty($arrTax))
|
413 |
$arrTax = array_flip($arrTax);
|
414 |
|
415 |
$taxonomy = UniteFunctionsUC::getVal($value, $name."_taxonomy");
|
416 |
if(empty($taxonomy))
|
417 |
$taxonomy = UniteFunctionsUC::getArrFirstValue($arrTax);
|
418 |
-
|
|
|
|
|
|
|
419 |
$this->addSelect($name."_taxonomy", $arrTaxonomiesSimple, __("Select Taxonomy", "unlimited-elements-for-elementor"), $taxonomy, $params);
|
420 |
|
421 |
// --------- add include by -------------
|
@@ -428,6 +438,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
428 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
429 |
$arrIncludeBy["meta"] = __("Term Meta","unlimited-elements-for-elementor");
|
430 |
|
|
|
431 |
$arrIncludeBy = array_flip($arrIncludeBy);
|
432 |
|
433 |
$params = array();
|
@@ -435,7 +446,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
435 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
436 |
|
437 |
$this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), "", $params);
|
438 |
-
|
|
|
439 |
// --------- include by meta key -------------
|
440 |
|
441 |
$params = array();
|
@@ -1220,6 +1232,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1220 |
|
1221 |
$arrIncludeBy["meta"] = __("Post Meta", "unlimited-elements-for-elementor");
|
1222 |
$arrIncludeBy["most_viewed"] = __("Most Viewed", "unlimited-elements-for-elementor");
|
|
|
|
|
1223 |
|
1224 |
|
1225 |
if($isForWooProducts == true){
|
@@ -1369,6 +1383,48 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1369 |
|
1370 |
$this->addTextBox($name."_includeby_metavalue", "", esc_html__("Include by Meta Value", "unlimited-elements-for-elementor"), $params);
|
1371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1372 |
// --------- include by most viewed -------------
|
1373 |
|
1374 |
$isWPPExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
|
@@ -1743,5 +1799,19 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1743 |
}
|
1744 |
|
1745 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1746 |
|
1747 |
}
|
363 |
*/
|
364 |
protected function addPostTermsPicker($name, $value, $title, $extra){
|
365 |
|
366 |
+
|
367 |
+
$isForWooCommerce = UniteFunctionsUC::getVal($extra, "for_woocommerce");
|
368 |
+
$isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
|
369 |
+
|
370 |
$arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
|
371 |
|
372 |
+
if($isForWooCommerce == true)
|
373 |
+
$arrPostTypesWithTax = array("product" => $arrPostTypesWithTax["product"]);
|
374 |
+
|
375 |
$taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
|
376 |
|
377 |
$arrPostTypesTaxonomies = $taxData["post_type_tax"];
|
415 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
416 |
|
417 |
$arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
|
418 |
+
|
419 |
if(!empty($arrTax))
|
420 |
$arrTax = array_flip($arrTax);
|
421 |
|
422 |
$taxonomy = UniteFunctionsUC::getVal($value, $name."_taxonomy");
|
423 |
if(empty($taxonomy))
|
424 |
$taxonomy = UniteFunctionsUC::getArrFirstValue($arrTax);
|
425 |
+
|
426 |
+
if($isForWooCommerce)
|
427 |
+
$taxonomy = "product_cat";
|
428 |
+
|
429 |
$this->addSelect($name."_taxonomy", $arrTaxonomiesSimple, __("Select Taxonomy", "unlimited-elements-for-elementor"), $taxonomy, $params);
|
430 |
|
431 |
// --------- add include by -------------
|
438 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
439 |
$arrIncludeBy["meta"] = __("Term Meta","unlimited-elements-for-elementor");
|
440 |
|
441 |
+
|
442 |
$arrIncludeBy = array_flip($arrIncludeBy);
|
443 |
|
444 |
$params = array();
|
446 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
447 |
|
448 |
$this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), "", $params);
|
449 |
+
|
450 |
+
|
451 |
// --------- include by meta key -------------
|
452 |
|
453 |
$params = array();
|
1232 |
|
1233 |
$arrIncludeBy["meta"] = __("Post Meta", "unlimited-elements-for-elementor");
|
1234 |
$arrIncludeBy["most_viewed"] = __("Most Viewed", "unlimited-elements-for-elementor");
|
1235 |
+
$arrIncludeBy["php_function"] = __("IDs from PHP function","unlimited-elements-for-elementor");
|
1236 |
+
$arrIncludeBy["ids_from_meta"] = __("IDs from Post Meta","unlimited-elements-for-elementor");
|
1237 |
|
1238 |
|
1239 |
if($isForWooProducts == true){
|
1383 |
|
1384 |
$this->addTextBox($name."_includeby_metavalue", "", esc_html__("Include by Meta Value", "unlimited-elements-for-elementor"), $params);
|
1385 |
|
1386 |
+
// --------- include by PHP Function -------------
|
1387 |
+
|
1388 |
+
$arrConditionIncludeFunction = $arrConditionIncludeBy;
|
1389 |
+
$arrConditionIncludeFunction[$name."_includeby"] = "php_function";
|
1390 |
+
|
1391 |
+
|
1392 |
+
$params = array();
|
1393 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1394 |
+
$params["placeholder"] = __("getMyIDs","unlimited-elements-for-elementor");
|
1395 |
+
$params["description"] = __("Get post id's array from php function. \n For example: function getMyIDs(\$arg){return(array(\"32\",\"58\")). This function MUST begin with 'get'. }");
|
1396 |
+
$params["elementor_condition"] = $arrConditionIncludeFunction;
|
1397 |
+
|
1398 |
+
$this->addTextBox($name."_includeby_function_name", "", esc_html__("PHP Function Name", "unlimited-elements-for-elementor"), $params);
|
1399 |
+
|
1400 |
+
// --------- include by PHP Function Add Parameter-------------
|
1401 |
+
|
1402 |
+
$params = array();
|
1403 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1404 |
+
$params["placeholder"] = __("yourtext","unlimited-elements-for-elementor");
|
1405 |
+
$params["description"] = __("Optional. Some argument to be passed to this function. For some \"IF\" statement.","unlimited-elements-for-elementor");
|
1406 |
+
$params["elementor_condition"] = $arrConditionIncludeFunction;
|
1407 |
+
|
1408 |
+
$this->addTextBox($name."_includeby_function_addparam", "", esc_html__("PHP Function Argument", "unlimited-elements-for-elementor"), $params);
|
1409 |
+
|
1410 |
+
// --------- include by id's from meta -------------
|
1411 |
+
|
1412 |
+
$textIDsFromMeta = __("Select Post (leave empty for current post)","unlimited-elements-for-elementor");
|
1413 |
+
$arrConditionIncludePostMeta = $arrConditionIncludeBy;
|
1414 |
+
$arrConditionIncludePostMeta[$name."_includeby"] = "ids_from_meta";
|
1415 |
+
|
1416 |
+
$this->addPostIDSelect($name."_includeby_postmeta_postid", $textIDsFromMeta, $arrConditionIncludePostMeta, false,"data-issingle='true'");
|
1417 |
+
|
1418 |
+
// --------- include by id's from meta field name -------------
|
1419 |
+
|
1420 |
+
$params = array();
|
1421 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1422 |
+
$params["description"] = __("Choose meta field name that has the post id's on it. Good for acf relationship for example","unlimited-elements-for-elementor");
|
1423 |
+
$params["elementor_condition"] = $arrConditionIncludePostMeta;
|
1424 |
+
|
1425 |
+
$this->addTextBox($name."_includeby_postmeta_metafield", "", esc_html__("Meta Field Name", "unlimited-elements-for-elementor"), $params);
|
1426 |
+
|
1427 |
+
|
1428 |
// --------- include by most viewed -------------
|
1429 |
|
1430 |
$isWPPExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
|
1799 |
}
|
1800 |
|
1801 |
|
1802 |
+
/**
|
1803 |
+
* add listing picker, function for override
|
1804 |
+
*/
|
1805 |
+
protected function addListingPicker($name,$value,$title,$extra){
|
1806 |
+
|
1807 |
+
$params = array();
|
1808 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1809 |
+
|
1810 |
+
$this->addTextBox($name."_type", "listing", "put listing here", $params);
|
1811 |
+
|
1812 |
+
|
1813 |
+
}
|
1814 |
+
|
1815 |
+
|
1816 |
|
1817 |
}
|
provider/provider_template_engine.class.php
CHANGED
@@ -167,7 +167,6 @@ class UniteCreatorTemplateEngine extends UniteCreatorTemplateEngineWork{
|
|
167 |
echo UniteProviderFunctionsUC::escCombinedHtml($htmlTags);
|
168 |
}
|
169 |
|
170 |
-
|
171 |
|
172 |
/**
|
173 |
* add extra functions to twig
|
167 |
echo UniteProviderFunctionsUC::escCombinedHtml($htmlTags);
|
168 |
}
|
169 |
|
|
|
170 |
|
171 |
/**
|
172 |
* add extra functions to twig
|
provider/woocommerce_integrate.class.php
CHANGED
@@ -328,7 +328,8 @@ class UniteCreatorWooIntegrate{
|
|
328 |
//add currency
|
329 |
$arrProduct["woo_currency"] = $this->currency;
|
330 |
$arrProduct["woo_currency_symbol"] = $this->currencySymbol;
|
331 |
-
|
|
|
332 |
//put add to cart link
|
333 |
$arrProduct = $this->addAddToCartData($arrProduct, $productID, $productSku);
|
334 |
|
328 |
//add currency
|
329 |
$arrProduct["woo_currency"] = $this->currency;
|
330 |
$arrProduct["woo_currency_symbol"] = $this->currencySymbol;
|
331 |
+
|
332 |
+
|
333 |
//put add to cart link
|
334 |
$arrProduct = $this->addAddToCartData($arrProduct, $productID, $productSku);
|
335 |
|
readme.txt
CHANGED
@@ -521,6 +521,19 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
|
|
521 |
|
522 |
== Changelog ==
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
version 1.4.70 = 2021-04-14
|
525 |
|
526 |
* Feature: added show widget data debug options
|
521 |
|
522 |
== Changelog ==
|
523 |
|
524 |
+
|
525 |
+
version 1.4.71 = 2021-04-22
|
526 |
+
|
527 |
+
* Feature: added option to take post id's from php function in post selection
|
528 |
+
* Feature: added option for get posts by meta field that located in current or different post
|
529 |
+
* Feature: added twig filter: wc_price for native price filtering
|
530 |
+
* Feature: added post terms titles to post data debug
|
531 |
+
* Change: added option for woocommerce categories in terms selection
|
532 |
+
* Fix: fixed price issues in woocommerce related grids
|
533 |
+
* Fix: fixed include and exclude terms mismatch with nested tax query
|
534 |
+
* Fix: fixed pagination on search pages
|
535 |
+
|
536 |
+
|
537 |
version 1.4.70 = 2021-04-14
|
538 |
|
539 |
* Feature: added show widget data debug options
|
release_log.txt
CHANGED
@@ -1,5 +1,18 @@
|
|
1 |
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
version 1.4.70
|
4 |
|
5 |
-bug fix: when bulk moving attribute it now always goes to general category
|
1 |
|
2 |
|
3 |
+
version 1.4.71
|
4 |
+
|
5 |
+
-change: added option for woocommerce categories in terms selection
|
6 |
+
-feature: added option to take post id's from php function in post selection
|
7 |
+
-bug fix: fixed price issues in woocommerce related grids
|
8 |
+
-feature: added option for get posts by meta field that located in current or different post
|
9 |
+
-feature: added twig filter: wc_price for native price filtering
|
10 |
+
-feature: added post terms titles to post data debug
|
11 |
+
-bug fix: fixed include and exclude terms mismatch with nested tax query
|
12 |
+
-bug fix: fixed pagination on search pages
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
version 1.4.70
|
17 |
|
18 |
-bug fix: when bulk moving attribute it now always goes to general category
|
unlimited_elements.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Unlimited Elements for Elementor
|
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor Page Builder, with html/css/js widget creator and editor
|
6 |
Author: Unlimited Elements
|
7 |
-
Version: 1.4.
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor Page Builder, with html/css/js widget creator and editor
|
6 |
Author: Unlimited Elements
|
7 |
+
Version: 1.4.71
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|
views/objects/addon_view_childparams.class.php
CHANGED
@@ -813,15 +813,30 @@ jQuery(document).ready(function(){
|
|
813 |
|
814 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
815 |
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
820 |
}
|
821 |
|
822 |
return($arrParams);
|
823 |
}
|
824 |
|
|
|
825 |
/**
|
826 |
* add woo commerce post param without post id
|
827 |
*/
|
813 |
|
814 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
815 |
|
816 |
+
foreach($arrKeys as $key){
|
817 |
+
|
818 |
+
switch($key){
|
819 |
+
case "woo_sale_price":
|
820 |
+
case "woo_regular_price":
|
821 |
+
case "woo_price":
|
822 |
+
case "woo_price_to":
|
823 |
+
case "woo_price_from":
|
824 |
+
case "woo_sale_price_to":
|
825 |
+
case "woo_sale_price_from":
|
826 |
+
case "woo_regular_price_from":
|
827 |
+
case "woo_regular_price_to":
|
828 |
+
$arrParams[] = $this->createChildParam($key,null,array("raw_insert_text"=>"{{[param_name]|wc_price|raw}}"));
|
829 |
+
break;
|
830 |
+
default:
|
831 |
+
$arrParams[] = $this->createChildParam($key);
|
832 |
+
break;
|
833 |
+
}
|
834 |
}
|
835 |
|
836 |
return($arrParams);
|
837 |
}
|
838 |
|
839 |
+
|
840 |
/**
|
841 |
* add woo commerce post param without post id
|
842 |
*/
|