Version Description
- Added - Documentation for several important functions part of the plugin
Download this release
Release Info
Developer | livemesh |
Plugin | Addons for Elementor |
Version | 7.2.0 |
Comparing to | |
See all releases |
Code changes from version 7.1.9 to 7.2.0
- addons-for-elementor.php +2 -2
- includes/helper-functions.php +141 -10
- includes/query-functions.php +21 -1
- plugin.php +2 -2
- readme.txt +4 -1
addons-for-elementor.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* Author URI: https://livemeshelementor.com
|
9 |
* License: GPL3
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
11 |
-
* Version: 7.
|
12 |
* Text Domain: livemesh-el-addons
|
13 |
* Domain Path: languages
|
14 |
* Elementor tested up to: 3.7.0
|
@@ -37,7 +37,7 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
37 |
|
38 |
if ( !function_exists( 'lae_fs' ) ) {
|
39 |
// Plugin version
|
40 |
-
define( 'LAE_VERSION', '7.
|
41 |
// Plugin Root File
|
42 |
define( 'LAE_PLUGIN_FILE', __FILE__ );
|
43 |
// Plugin Folder Path
|
8 |
* Author URI: https://livemeshelementor.com
|
9 |
* License: GPL3
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
11 |
+
* Version: 7.2.0
|
12 |
* Text Domain: livemesh-el-addons
|
13 |
* Domain Path: languages
|
14 |
* Elementor tested up to: 3.7.0
|
37 |
|
38 |
if ( !function_exists( 'lae_fs' ) ) {
|
39 |
// Plugin version
|
40 |
+
define( 'LAE_VERSION', '7.2.0' );
|
41 |
// Plugin Root File
|
42 |
define( 'LAE_PLUGIN_FILE', __FILE__ );
|
43 |
// Plugin Folder Path
|
includes/helper-functions.php
CHANGED
@@ -5,6 +5,11 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
5 |
exit;
|
6 |
}
|
7 |
use Elementor\Group_Control_Image_Size ;
|
|
|
|
|
|
|
|
|
|
|
8 |
function lae_get_terms( $taxonomy )
|
9 |
{
|
10 |
global $wpdb ;
|
@@ -31,6 +36,14 @@ function lae_get_terms( $taxonomy )
|
|
31 |
return $term_coll;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
function lae_entry_terms_list(
|
35 |
$taxonomy = 'category',
|
36 |
$separator = ', ',
|
@@ -51,6 +64,14 @@ function lae_entry_terms_list(
|
|
51 |
return $output;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
function lae_get_chosen_terms( $query_args )
|
55 |
{
|
56 |
$chosen_terms = array();
|
@@ -89,6 +110,13 @@ function lae_get_chosen_terms( $query_args )
|
|
89 |
return apply_filters( 'lae_chosen_taxonomy_terms', $return, $query_args );
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
function lae_get_taxonomy_info( $taxonomy )
|
93 |
{
|
94 |
$output = '';
|
@@ -115,6 +143,11 @@ function lae_get_taxonomy_info( $taxonomy )
|
|
115 |
return apply_filters( 'lae_taxonomy_info', $output, $taxonomy );
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
118 |
function lae_get_info_for_taxonomies( $taxonomies )
|
119 |
{
|
120 |
$output = '';
|
@@ -124,7 +157,12 @@ function lae_get_info_for_taxonomies( $taxonomies )
|
|
124 |
return apply_filters( 'lae_taxonomies_info', $output, $taxonomies );
|
125 |
}
|
126 |
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
128 |
function lae_get_taxonomies_map()
|
129 |
{
|
130 |
$map = array();
|
@@ -135,6 +173,10 @@ function lae_get_taxonomies_map()
|
|
135 |
return apply_filters( 'lae_taxonomies_map', $map );
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
138 |
function lae_get_all_taxonomies()
|
139 |
{
|
140 |
$taxonomies = get_taxonomies( array(
|
@@ -148,6 +190,11 @@ function lae_get_all_taxonomies()
|
|
148 |
return $taxonomies;
|
149 |
}
|
150 |
|
|
|
|
|
|
|
|
|
|
|
151 |
function lae_entry_published( $format = null )
|
152 |
{
|
153 |
if ( empty($format) ) {
|
@@ -159,13 +206,23 @@ function lae_entry_published( $format = null )
|
|
159 |
return apply_filters( 'lae_entry_published_link', $link, $format );
|
160 |
}
|
161 |
|
|
|
|
|
|
|
|
|
162 |
function lae_entry_author()
|
163 |
{
|
164 |
$author = '<span class="author vcard">' . esc_html__( 'By ', 'livemesh-el-addons' ) . '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a></span>';
|
165 |
return apply_filters( 'lae_entry_author', $author );
|
166 |
}
|
167 |
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
function lae_get_grid_classes( $settings, $columns_field = 'per_line' )
|
170 |
{
|
171 |
|
@@ -188,9 +245,12 @@ function lae_get_grid_classes( $settings, $columns_field = 'per_line' )
|
|
188 |
);
|
189 |
}
|
190 |
|
191 |
-
|
192 |
-
*
|
193 |
-
|
|
|
|
|
|
|
194 |
function lae_to_boolean( $value )
|
195 |
{
|
196 |
if ( !isset( $value ) ) {
|
@@ -235,6 +295,12 @@ function lae_color_luminance( $hex, $percent )
|
|
235 |
return $new_hex;
|
236 |
}
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
function lae_get_option( $option_name, $default = null )
|
239 |
{
|
240 |
$settings = get_option( 'lae_settings' );
|
@@ -253,6 +319,13 @@ function lae_get_option( $option_name, $default = null )
|
|
253 |
);
|
254 |
}
|
255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
function lae_update_option( $option_name, $option_value )
|
257 |
{
|
258 |
$settings = get_option( 'lae_settings' );
|
@@ -264,8 +337,8 @@ function lae_update_option( $option_name, $option_value )
|
|
264 |
}
|
265 |
|
266 |
/**
|
267 |
-
* Update multiple options in one go
|
268 |
-
* @param array $setting_data
|
269 |
*/
|
270 |
function lae_update_options( $setting_data )
|
271 |
{
|
@@ -282,8 +355,9 @@ function lae_update_options( $setting_data )
|
|
282 |
}
|
283 |
|
284 |
/**
|
285 |
-
* Get system
|
286 |
-
*
|
|
|
287 |
*/
|
288 |
function lae_get_sysinfo()
|
289 |
{
|
@@ -387,6 +461,15 @@ function lae_get_sysinfo()
|
|
387 |
return $return;
|
388 |
}
|
389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
function lae_get_image_html(
|
391 |
$image_setting,
|
392 |
$image_size_key,
|
@@ -481,6 +564,11 @@ function lae_get_image_html(
|
|
481 |
);
|
482 |
}
|
483 |
|
|
|
|
|
|
|
|
|
|
|
484 |
function lae_get_image_alt( $attachment_id )
|
485 |
{
|
486 |
if ( empty($attachment_id) ) {
|
@@ -506,7 +594,12 @@ function lae_get_image_alt( $attachment_id )
|
|
506 |
return apply_filters( 'lae_image_alt', $alt, $attachment_id );
|
507 |
}
|
508 |
|
509 |
-
/**
|
|
|
|
|
|
|
|
|
|
|
510 |
function lae_get_taxonomy_terms_filter( $taxonomies, $chosen_terms = array() )
|
511 |
{
|
512 |
$output = '';
|
@@ -552,6 +645,11 @@ function lae_get_taxonomy_terms_filter( $taxonomies, $chosen_terms = array() )
|
|
552 |
);
|
553 |
}
|
554 |
|
|
|
|
|
|
|
|
|
|
|
555 |
function lae_get_animation_atts( $animation )
|
556 |
{
|
557 |
$animate_class = "";
|
@@ -602,6 +700,10 @@ function lae_get_animation_atts( $animation )
|
|
602 |
return apply_filters( 'lae_animation_attributes', $return, $animation );
|
603 |
}
|
604 |
|
|
|
|
|
|
|
|
|
605 |
function lae_get_animation_options()
|
606 |
{
|
607 |
return apply_filters( 'lae_animation_options', array(
|
@@ -612,6 +714,14 @@ function lae_get_animation_options()
|
|
612 |
) );
|
613 |
}
|
614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
615 |
function lae_get_template_part( $template_name, $args = null, $return = false )
|
616 |
{
|
617 |
$template_file = $template_name . '.php';
|
@@ -638,6 +748,12 @@ function lae_get_template_part( $template_name, $args = null, $return = false )
|
|
638 |
return null;
|
639 |
}
|
640 |
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
function lae_shorten_number_format( $n, $precision = 1 )
|
642 |
{
|
643 |
|
@@ -666,6 +782,11 @@ function lae_shorten_number_format( $n, $precision = 1 )
|
|
666 |
return $n_format;
|
667 |
}
|
668 |
|
|
|
|
|
|
|
|
|
|
|
669 |
function lae_disable_lazy_load_classes()
|
670 |
{
|
671 |
// no-lazyload - wp-smushit
|
@@ -676,6 +797,11 @@ function lae_disable_lazy_load_classes()
|
|
676 |
return apply_filters( 'lae_disable_lazy_load_classes', 'skip-lazy no-lazyload exclude-me a3-notlazy' );
|
677 |
}
|
678 |
|
|
|
|
|
|
|
|
|
|
|
679 |
function lae_template_error( $error_string )
|
680 |
{
|
681 |
$output = '<div class="lae-template-error">';
|
@@ -684,6 +810,11 @@ function lae_template_error( $error_string )
|
|
684 |
return $output;
|
685 |
}
|
686 |
|
|
|
|
|
|
|
|
|
|
|
687 |
function lae_validate_html_tag( $tag )
|
688 |
{
|
689 |
$allowed_html_tags = [
|
5 |
exit;
|
6 |
}
|
7 |
use Elementor\Group_Control_Image_Size ;
|
8 |
+
/**
|
9 |
+
* Get all the taxonomy terms with term id as the key and term name as value
|
10 |
+
* @param $taxonomy The taxonomy for which the terms are to be fetched
|
11 |
+
* @return array A collection of taxonomy terms with term id as key and term name as value
|
12 |
+
*/
|
13 |
function lae_get_terms( $taxonomy )
|
14 |
{
|
15 |
global $wpdb ;
|
36 |
return $term_coll;
|
37 |
}
|
38 |
|
39 |
+
/**
|
40 |
+
* Retrieve a comma separated list of taxonomy terms list for the current post
|
41 |
+
* @param $taxonomy Optional. Default is category.
|
42 |
+
* @param $separator Optional. By default the list is comma separated
|
43 |
+
* @param $before Optional. The prefix to add to the output list
|
44 |
+
* @param $after Optional. The suffix to add to the output list
|
45 |
+
* @return string A comma separated list of taxonomy terms list for the current post
|
46 |
+
*/
|
47 |
function lae_entry_terms_list(
|
48 |
$taxonomy = 'category',
|
49 |
$separator = ', ',
|
64 |
return $output;
|
65 |
}
|
66 |
|
67 |
+
/**
|
68 |
+
* Get the taxonomy terms, if any, chosen for querying posts.
|
69 |
+
* We should use these only as filter terms for taxonomy filter. It does not make sense
|
70 |
+
* to show other terms for the taxonomy since the posts are not present for those
|
71 |
+
* terms based on the custom query generated by the user.
|
72 |
+
* @param $query_args The posts query created based on user input
|
73 |
+
* @return mixed|void An empty array or an array with two elements - chosen terms and chosen taxonomies
|
74 |
+
*/
|
75 |
function lae_get_chosen_terms( $query_args )
|
76 |
{
|
77 |
$chosen_terms = array();
|
110 |
return apply_filters( 'lae_chosen_taxonomy_terms', $return, $query_args );
|
111 |
}
|
112 |
|
113 |
+
/**
|
114 |
+
* Obtain the taxonomy information for the current post like the category it belongs
|
115 |
+
* to or the tags it has. This will be displayed along with other post information
|
116 |
+
* like the posted date, author, title, thumbnail etc.
|
117 |
+
* @param $taxonomy The taxonomy (category, tags, portfolio category etc.) for which the terms are returned
|
118 |
+
* @return string A comma separated list of taxonomy terms for the current post
|
119 |
+
*/
|
120 |
function lae_get_taxonomy_info( $taxonomy )
|
121 |
{
|
122 |
$output = '';
|
143 |
return apply_filters( 'lae_taxonomy_info', $output, $taxonomy );
|
144 |
}
|
145 |
|
146 |
+
/**
|
147 |
+
* Get the taxonomy information for the current post
|
148 |
+
* @param $taxonomies The taxonomies for which the taxonomy information is requested
|
149 |
+
* @return string A comma separated list of taxonomy terms for the current post
|
150 |
+
*/
|
151 |
function lae_get_info_for_taxonomies( $taxonomies )
|
152 |
{
|
153 |
$output = '';
|
157 |
return apply_filters( 'lae_taxonomies_info', $output, $taxonomies );
|
158 |
}
|
159 |
|
160 |
+
/**
|
161 |
+
* Get all the registered taxonomies. We use this to display the list of available
|
162 |
+
* taxonomies in the database. The user can choose one or more of these to
|
163 |
+
* filter the posts returned for display in a posts grid or a posts carousel or posts slider
|
164 |
+
* @return array List of all registered taxonomies in the system
|
165 |
+
*/
|
166 |
function lae_get_taxonomies_map()
|
167 |
{
|
168 |
$map = array();
|
173 |
return apply_filters( 'lae_taxonomies_map', $map );
|
174 |
}
|
175 |
|
176 |
+
/**
|
177 |
+
* Obtain all the taxonomies which are registered in the system and which are public
|
178 |
+
* @return string[]|WP_Taxonomy[] An array of taxonomy names or objects.
|
179 |
+
*/
|
180 |
function lae_get_all_taxonomies()
|
181 |
{
|
182 |
$taxonomies = get_taxonomies( array(
|
190 |
return $taxonomies;
|
191 |
}
|
192 |
|
193 |
+
/**
|
194 |
+
* Obtain the posted date/time for the current post
|
195 |
+
* @param $format Optional. The desired format for the post date
|
196 |
+
* @return string The posted date/time for the current post
|
197 |
+
*/
|
198 |
function lae_entry_published( $format = null )
|
199 |
{
|
200 |
if ( empty($format) ) {
|
206 |
return apply_filters( 'lae_entry_published_link', $link, $format );
|
207 |
}
|
208 |
|
209 |
+
/**
|
210 |
+
* Obtain the author information for the current post
|
211 |
+
* @return string The author information for the current post
|
212 |
+
*/
|
213 |
function lae_entry_author()
|
214 |
{
|
215 |
$author = '<span class="author vcard">' . esc_html__( 'By ', 'livemesh-el-addons' ) . '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author_meta( 'display_name' ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a></span>';
|
216 |
return apply_filters( 'lae_entry_author', $author );
|
217 |
}
|
218 |
|
219 |
+
/**
|
220 |
+
* Return the css class names to help achieve the number of columns specified separately
|
221 |
+
* for desktop, tablet and the mobile resolutions by the user in the settings.
|
222 |
+
* @param $settings The object which has all the user settings as captured in the widget settings by the user
|
223 |
+
* @param $columns_field The settings field which captures column information for various resolutions
|
224 |
+
* @return string The class names capturing column information for various resolutions
|
225 |
+
*/
|
226 |
function lae_get_grid_classes( $settings, $columns_field = 'per_line' )
|
227 |
{
|
228 |
|
245 |
);
|
246 |
}
|
247 |
|
248 |
+
/**
|
249 |
+
* Given a string indicated a true or false value, give me the boolean object.
|
250 |
+
* Converting string to boolean is a big one in PHP
|
251 |
+
* @param $value The string which indicates a boolean value
|
252 |
+
* @return bool The boolean value for the string specified
|
253 |
+
*/
|
254 |
function lae_to_boolean( $value )
|
255 |
{
|
256 |
if ( !isset( $value ) ) {
|
295 |
return $new_hex;
|
296 |
}
|
297 |
|
298 |
+
/**
|
299 |
+
* Fetch the value of the option specified by the user in the Settings page under Livemesh Addons->Settings
|
300 |
+
* @param $option_name The name of the option for which the value is desired
|
301 |
+
* @param $default The default value if the option is not set
|
302 |
+
* @return string The value of the option specified by the user
|
303 |
+
*/
|
304 |
function lae_get_option( $option_name, $default = null )
|
305 |
{
|
306 |
$settings = get_option( 'lae_settings' );
|
319 |
);
|
320 |
}
|
321 |
|
322 |
+
/**
|
323 |
+
* Update the option in the DB for the option name specified. This is managed in
|
324 |
+
* the Settings page under Livemesh Addons->Settings
|
325 |
+
* @param $option_name The name of the option which needs to be updated
|
326 |
+
* @param $option_value The new value for the option which needs updation
|
327 |
+
* @return void
|
328 |
+
*/
|
329 |
function lae_update_option( $option_name, $option_value )
|
330 |
{
|
331 |
$settings = get_option( 'lae_settings' );
|
337 |
}
|
338 |
|
339 |
/**
|
340 |
+
* Update multiple options in one go for the Settings page under Livemesh Addons->Settings
|
341 |
+
* @param array $setting_data A collection of settings key value pairs;
|
342 |
*/
|
343 |
function lae_update_options( $setting_data )
|
344 |
{
|
355 |
}
|
356 |
|
357 |
/**
|
358 |
+
* Get system or the server information like the site URL, plugins installed, WP version, PHP Info etc.
|
359 |
+
* useful for debugging purposes. This is displayed in the Settings page under Livemesh Addons -> Settings.
|
360 |
+
* @return string The information about the current WP setup
|
361 |
*/
|
362 |
function lae_get_sysinfo()
|
363 |
{
|
461 |
return $return;
|
462 |
}
|
463 |
|
464 |
+
/**
|
465 |
+
* Fetch the HTML for the image thumbnail displayed on the frontend. This can be post thumbnail or a user chosen
|
466 |
+
* custom image as in gallery or widgets like team members, features, clients, services etc.
|
467 |
+
* @param $image_setting The image settings like the post id, URL etc. which enable us to fetch the image
|
468 |
+
* @param $image_size_key The size of the image desired
|
469 |
+
* @param $settings The object which has all the user settings as captured in the widget settings by the user
|
470 |
+
* @param $disable_lazy_load Optional. Whether the lazy load for the image needs to be disabled. By default, lazy load is enabled.
|
471 |
+
* @return string The HTML which has the image URL with required attributes like class names, lazy load info etc.
|
472 |
+
*/
|
473 |
function lae_get_image_html(
|
474 |
$image_setting,
|
475 |
$image_size_key,
|
564 |
);
|
565 |
}
|
566 |
|
567 |
+
/**
|
568 |
+
* Obtain the image ALT information from the media library for the attachment id provided
|
569 |
+
* @param $attachment_id The id of the attachment in the media library
|
570 |
+
* @return string|void The ALT information for the image attachment id provided
|
571 |
+
*/
|
572 |
function lae_get_image_alt( $attachment_id )
|
573 |
{
|
574 |
if ( empty($attachment_id) ) {
|
594 |
return apply_filters( 'lae_image_alt', $alt, $attachment_id );
|
595 |
}
|
596 |
|
597 |
+
/**
|
598 |
+
* The isotope library based taxonomy terms filter displayed for the free version of the posts grid or the portfolio widget
|
599 |
+
* @param $taxonomies The taxonomies whose terms are displayed in the filter
|
600 |
+
* @param $chosen_terms Optional. If the user has chosen to display posts for only certain taxonomy terms, use the same as terms list
|
601 |
+
* @return string The HTML which captures the taxonomy terms filter displayed for posts grid
|
602 |
+
*/
|
603 |
function lae_get_taxonomy_terms_filter( $taxonomies, $chosen_terms = array() )
|
604 |
{
|
605 |
$output = '';
|
645 |
);
|
646 |
}
|
647 |
|
648 |
+
/**
|
649 |
+
* Obtain the HTML attributes like class and the data attributes to be displayed for the animation chosen by the user
|
650 |
+
* @param $animation The animation chosen by the user in the widget settings
|
651 |
+
* @return string The HTML attributes like class and the data attributes to be displayed for the animation
|
652 |
+
*/
|
653 |
function lae_get_animation_atts( $animation )
|
654 |
{
|
655 |
$animate_class = "";
|
700 |
return apply_filters( 'lae_animation_attributes', $return, $animation );
|
701 |
}
|
702 |
|
703 |
+
/**
|
704 |
+
* The animation options available in the settings for widgets like Services, Team members, Features, Clients, Buttons, Heading etc.
|
705 |
+
* @return array The key value pairs of available animations for display in the widget settings UI
|
706 |
+
*/
|
707 |
function lae_get_animation_options()
|
708 |
{
|
709 |
return apply_filters( 'lae_animation_options', array(
|
714 |
) );
|
715 |
}
|
716 |
|
717 |
+
/**
|
718 |
+
* Loads the template name specified from templates folder or in the theme folder name addons-for-elementor/, if overridden by the user.
|
719 |
+
* This helps users to tweak or completely override the default frontend output generated by the widgets.
|
720 |
+
* @param $template_name The name of the template with the relative path
|
721 |
+
* @param $args Optional. The arguments to be extracted and passed to the template, like the settings object
|
722 |
+
* @param $return Optional Whether the result of the template loaded needs to be returned instead of displayed inline
|
723 |
+
* @return false|string|null If $return is true, the result of the template execution is returned
|
724 |
+
*/
|
725 |
function lae_get_template_part( $template_name, $args = null, $return = false )
|
726 |
{
|
727 |
$template_file = $template_name . '.php';
|
748 |
return null;
|
749 |
}
|
750 |
|
751 |
+
/**
|
752 |
+
* Shorten large numbers like the views generated, likes, followers count etc. to a user-readable format
|
753 |
+
* @param $n The number to be represented in a shortened format
|
754 |
+
* @param $precision
|
755 |
+
* @return string The formatted number string which is human-readable
|
756 |
+
*/
|
757 |
function lae_shorten_number_format( $n, $precision = 1 )
|
758 |
{
|
759 |
|
782 |
return $n_format;
|
783 |
}
|
784 |
|
785 |
+
/**
|
786 |
+
* The classes that enable you to disable lazy load for widgets like posts grid and gallery. The isotope library
|
787 |
+
* used for grid and filtering the posts or items does not work well when lazy load is enabled.
|
788 |
+
* @return string The space separated list of classes that disable lazy load for images
|
789 |
+
*/
|
790 |
function lae_disable_lazy_load_classes()
|
791 |
{
|
792 |
// no-lazyload - wp-smushit
|
797 |
return apply_filters( 'lae_disable_lazy_load_classes', 'skip-lazy no-lazyload exclude-me a3-notlazy' );
|
798 |
}
|
799 |
|
800 |
+
/**
|
801 |
+
* A helper function to raise error encountered when handling theme builder templates in Elementor PRO
|
802 |
+
* @param $error_string The error string to be displayed on error
|
803 |
+
* @return string The HTML that represents the error encountered
|
804 |
+
*/
|
805 |
function lae_template_error( $error_string )
|
806 |
{
|
807 |
$output = '<div class="lae-template-error">';
|
810 |
return $output;
|
811 |
}
|
812 |
|
813 |
+
/**
|
814 |
+
* Validates the HTML tags used for displaying titles, headings etc. Defaults to the DIV tag if the tag specified is not supported by the plugin.
|
815 |
+
* @param $tag The HTML tag which needs validation
|
816 |
+
* @return mixed|string The HTML tag which is valid
|
817 |
+
*/
|
818 |
function lae_validate_html_tag( $tag )
|
819 |
{
|
820 |
$allowed_html_tags = [
|
includes/query-functions.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
function lae_get_all_post_type_options() {
|
4 |
|
5 |
$post_types = get_post_types(array('public' => true), 'objects');
|
@@ -14,7 +20,10 @@ function lae_get_all_post_type_options() {
|
|
14 |
}
|
15 |
|
16 |
/**
|
17 |
-
*
|
|
|
|
|
|
|
18 |
*/
|
19 |
function lae_get_all_taxonomy_options() {
|
20 |
|
@@ -30,6 +39,12 @@ function lae_get_all_taxonomy_options() {
|
|
30 |
return apply_filters('lae_taxonomy_options', $results);
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
function lae_build_query_args($settings) {
|
34 |
|
35 |
if ($settings['query_type'] == 'current_query') {
|
@@ -140,6 +155,11 @@ function lae_build_query_args($settings) {
|
|
140 |
return apply_filters('lae_posts_query_args', $query_args, $settings);
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
143 |
function lae_default_query_args($settings) {
|
144 |
|
145 |
$query_args = [
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Get all the registered posts types. We use this to display the list of available
|
5 |
+
* post types in the database. The user can choose one or more of these to
|
6 |
+
* filter the posts returned for display in a posts grid or a posts carousel or posts sliders
|
7 |
+
* @return array The list of post type name and post type label pairs
|
8 |
+
*/
|
9 |
function lae_get_all_post_type_options() {
|
10 |
|
11 |
$post_types = get_post_types(array('public' => true), 'objects');
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
+
* Get all the registered taxonomies. We use this to display the list of available
|
24 |
+
* taxonomies in the database. The user can choose one or more of these to
|
25 |
+
* filter the posts returned for display in a posts grid or a posts carousel or posts slider
|
26 |
+
* @return array List of all registered taxonomies in the system
|
27 |
*/
|
28 |
function lae_get_all_taxonomy_options() {
|
29 |
|
39 |
return apply_filters('lae_taxonomy_options', $results);
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
* An important function that builds the posts query from the options chosen by the user in the widget settings.
|
44 |
+
* Applicable to widgets that display custom posts like the posts carousel, posts block, posts grid, posts slider etc.
|
45 |
+
* @param $settings The settings object which captures the posts query options set by the user
|
46 |
+
* @return array A list of posts query options like post type, post instances, taxonomies etc.
|
47 |
+
*/
|
48 |
function lae_build_query_args($settings) {
|
49 |
|
50 |
if ($settings['query_type'] == 'current_query') {
|
155 |
return apply_filters('lae_posts_query_args', $query_args, $settings);
|
156 |
}
|
157 |
|
158 |
+
/**
|
159 |
+
* The default posts query arguments used in posts grid, posts block, posts sliders and carousels
|
160 |
+
* @param $settings The settings object which captures the posts query options set by the user
|
161 |
+
* @return array A default list of posts query options
|
162 |
+
*/
|
163 |
function lae_default_query_args($settings) {
|
164 |
|
165 |
$query_args = [
|
plugin.php
CHANGED
@@ -45,7 +45,7 @@ if ( !class_exists( 'Livemesh_Elementor_Addons' ) ) {
|
|
45 |
public function __clone()
|
46 |
{
|
47 |
// Cloning instances of the class is forbidden
|
48 |
-
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'livemesh-el-addons' ), '7.
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -55,7 +55,7 @@ if ( !class_exists( 'Livemesh_Elementor_Addons' ) ) {
|
|
55 |
public function __wakeup()
|
56 |
{
|
57 |
// Unserializing instances of the class is forbidden
|
58 |
-
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'livemesh-el-addons' ), '7.
|
59 |
}
|
60 |
|
61 |
private function setup_debug_constants()
|
45 |
public function __clone()
|
46 |
{
|
47 |
// Cloning instances of the class is forbidden
|
48 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'livemesh-el-addons' ), '7.2.0' );
|
49 |
}
|
50 |
|
51 |
/**
|
55 |
public function __wakeup()
|
56 |
{
|
57 |
// Unserializing instances of the class is forbidden
|
58 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'livemesh-el-addons' ), '7.2.0' );
|
59 |
}
|
60 |
|
61 |
private function setup_debug_constants()
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tags: elementor, elementor addons, elementor extensions, elementor widgets, page
|
|
7 |
Requires at least: 5.2
|
8 |
Tested up to: 6.0
|
9 |
Requires PHP: 5.6
|
10 |
-
Stable Tag: 7.
|
11 |
License: GPLv3
|
12 |
License URI: https://opensource.org/licenses/GPL-3.0
|
13 |
|
@@ -259,6 +259,9 @@ Email us at support[at]livemeshthemes.com and we will be happy to assist you.
|
|
259 |
|
260 |
|
261 |
|
|
|
|
|
|
|
262 |
= 7.1.9 =
|
263 |
* Added - Gradient background for Posts Slider, Posts Multislider and Posts Gridbox Slider
|
264 |
* Fixed - Some styles of Posts Slider, Posts Multislider and Posts Gridbox Slider displaying unwanted background overlay
|
7 |
Requires at least: 5.2
|
8 |
Tested up to: 6.0
|
9 |
Requires PHP: 5.6
|
10 |
+
Stable Tag: 7.2.0
|
11 |
License: GPLv3
|
12 |
License URI: https://opensource.org/licenses/GPL-3.0
|
13 |
|
259 |
|
260 |
|
261 |
|
262 |
+
= 7.2.0 =
|
263 |
+
* Added - Documentation for several important functions part of the plugin
|
264 |
+
|
265 |
= 7.1.9 =
|
266 |
* Added - Gradient background for Posts Slider, Posts Multislider and Posts Gridbox Slider
|
267 |
* Fixed - Some styles of Posts Slider, Posts Multislider and Posts Gridbox Slider displaying unwanted background overlay
|