Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/royal-elementor-addons/admin/plugin-options.php
+++ b/royal-elementor-addons/admin/plugin-options.php
@@ -120,6 +120,8 @@
register_setting('wpr-extension-settings', 'wpr-parallax-multi-layer');
register_setting('wpr-extension-settings', 'wpr-custom-css');
register_setting('wpr-extension-settings', 'wpr-display-conditions');
+ register_setting('wpr-extension-settings', 'wpr-equal-height');
+ // register_setting('wpr-extension-settings', 'wpr-column-slider');
register_setting('wpr-extension-settings', 'wpr-sticky-section');
// Element Toggle
@@ -1630,6 +1632,12 @@
echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
} elseif ( 'wpr-display-conditions' === $option_name ) {
echo '<br><span>Tip: Edit any Element > Navigate to Visibility tab</span>';
+ } elseif ( 'wpr-column-slider' === $option_name ) {
+ echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
+ // echo '<a href="https://www.youtube.com" target="_blank">Watch Video Tutorial</a>';
+ } elseif ( 'wpr-equal-height' === $option_name ) {
+ echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
+ // echo '<a href="https://www.youtube.com" target="_blank">Watch Video Tutorial</a>';
}
// echo '<a href="https://royal-elementor-addons.com/elementor-particle-effects/?ref=rea-plugin-backend-extentions-prev">'. esc_html('View Extension Demo', 'wpr-addons') .'</a>';
--- a/royal-elementor-addons/admin/templates/library/wpr-templates-data.php
+++ b/royal-elementor-addons/admin/templates/library/wpr-templates-data.php
@@ -97,6 +97,18 @@
'label' => 'new',
'priority' => 200,
],
+ 'v2' => [
+ 'name' => 'Plumbing V2',
+ 'pages' => 'home,about,services,service-single,blog,single-blog,contact,',
+ 'plugins' => '{}',
+ 'tags' => 'free plumbing solutions repair pipe replacement water cleanup fix bathroom emergency technician professional support plumber electrician handyman solar maintenance contractor hvac',
+ 'theme-builder' => true,
+ 'woo-builder' => false,
+ 'off-canvas' => true,
+ 'price' => $is_pro_active ? 'free' : 'free',
+ 'label' => 'new',
+ 'priority' => 200,
+ ],
],
'grocery-store' => [
'v1' => [
@@ -139,6 +151,20 @@
'priority' => 150,
],
],
+ 'coffee-shop' => [
+ 'v1' => [
+ 'name' => 'Coffee Shop V1',
+ 'pages' => 'home,about,services,faq,blog,single-blog,contact,',
+ 'plugins' => '{}',
+ 'tags' => 'free coffee shop bakery cofe bar cafe cafee cooking business corporate food menu restaurant tea beverage cafeteria barista blog',
+ 'theme-builder' => true,
+ 'woo-builder' => false,
+ 'off-canvas' => true,
+ 'price' => $is_pro_active ? 'free' : 'free',
+ 'label' => 'new',
+ 'priority' => 100,
+ ],
+ ],
'ico-landing-page' => [
'v1' => [
'name' => 'ICO - Landing Page',
@@ -822,7 +848,7 @@
'name' => 'Fitness Gym',
'pages' => 'home,about,gallery,classes,pricing,gallery,review,trainers,contact,comingsoon,',
'plugins' => '{"contact-form-7":'. $is_cf7_active .', "media-library-assistant":'. $is_mla_active .'}',
- 'tags' => 'free personal trainer gym sport fitness yoga exercises workout cardio strength training weightlifting crossfit hiit bodyweight exercises muscle building bodybuilding powerlifting',
+ 'tags' => 'free personal trainer gym sport fitness yoga exercises workout cardio strength training weightlifting crossfit hiit bodyweight exercises muscle building bodybuilding powerlifting health weight',
'theme-builder' => true,
'woo-builder' => false,
'off-canvas' => false,
@@ -831,6 +857,20 @@
'priority' => 21,
],
],
+ 'fitness-coach' => [
+ 'v1' => [
+ 'name' => 'Fitness Coach V1',
+ 'pages' => 'home,about,programs,pricing,blog,blog-single,contact,',
+ 'plugins' => '{}',
+ 'tags' => 'free fitness coach personal train gym workout exercise nutrition health cardio muscle athlete strength fit sport weight loss training trainer exercises',
+ 'theme-builder' => true,
+ 'woo-builder' => false,
+ 'off-canvas' => true,
+ 'price' => $is_pro_active ? 'free' : 'free',
+ 'label' => 'new',
+ 'priority' => 21,
+ ],
+ ],
'food-blog' => [
'v1' => [
'name' => 'Food Blog',
@@ -2004,6 +2044,20 @@
'label' => 'New',
'priority' => 270,
],
+ 'v5' => [
+ 'name' => 'Real Estate V5',
+ 'pages' => 'home,projects,project-details,services,service-details,about-us,awards,team,faq,blog,single-blog,contact,',
+ 'plugins' => '{}',
+ 'tags' => 'real estate agency company property rentals home estate sales developers construction agency property rentals sales property agent flat homes rent sale listing realtor broker acf dynamic houses apartment rental development land investment',
+ 'theme-builder' => true,
+ 'woo-builder' => false,
+ 'off-canvas' => true,
+ 'price' => $is_pro_active ? 'free' : 'pro',
+ 'expert' => $is_expert ? 'free' : 'expert',
+ 'custom-types' => ['project' => 'project', 'project_budget' => 'project_budget', 'project-status' => 'project-status', 'project_type' => 'project_type', 'location' => 'location'],
+ 'label' => 'New',
+ 'priority' => 260,
+ ],
],
'real-estate-consultant' => [
'v1' => [
@@ -2250,6 +2304,12 @@
'preview' => ['home','home-v2','about','directory','blog','contact'],
'price' => $is_pro_active ? 'free' : 'pro',
],
+ 'realestate-v5' => [
+ 'name' => 'Real Estate V5',
+ 'pages' => ['home','services','service-details','about-us','awards','team','faq','blog','contact'],
+ 'preview' => ['home','services','service-details','about-us','awards','team','faq','blog','contact'],
+ 'price' => $is_pro_active ? 'free' : 'pro',
+ ],
'realestate-v2' => [
'name' => 'Real Estate',
'pages' => ['home','about','services','property','details','agents','blog','contact'],
@@ -2748,6 +2808,12 @@
'preview' => ['home','about','services','pricing','contact',],
'price' => $is_pro_active ? 'free' : 'free',
],
+ 'plumbing-v2' => [
+ 'name' => 'Plumbing V2',
+ 'pages' => ['home','about','services','service-single','blog','contact',],
+ 'preview' => ['home','about','services','service-single','blog','contact',],
+ 'price' => $is_pro_active ? 'free' : 'free',
+ ],
'photographer-v1' => [
'name' => 'Photographer Dark',
'pages' => ['home','about','services','portfolio','contact'],
@@ -2790,6 +2856,13 @@
'preview' => ['home','about','gallery','classes','pricing','review','trainers','blog','contact','coming-soon'],
'price' => $is_pro_active ? 'free' : 'pro',
],
+ 'fitness-coach-v1' => [
+ 'name' => 'Fitness Coach V1',
+ 'pages' => ['home','blog','contact'],
+ 'preview' => ['home','blog','contact'],
+ 'price' => $is_pro_active ? 'free' : 'free',
+ ],
+
'personal-coach-v1' => [
'name' => 'Personal Coach V1',
'pages' => ['home','coaching','details','services','blog','contact'],
@@ -2874,6 +2947,13 @@
'preview' => ['home','menu','about','offer','gallery','contact'],
'price' => $is_pro_active ? 'free' : 'pro',
],
+ 'coffee-shop-v1' => [
+ 'name' => 'Coffee Shop V1',
+ 'pages' => ['home','about','services','faq','blog','contact'],
+ 'preview' => ['home','about','services','faq','blog','contact'],
+ 'price' => $is_pro_active ? 'free' : 'free',
+ ],
+
'winebar-v1' => [
'name' => 'Wine Bar',
'pages' => ['home','story','wines','dishes','events','contact'],
--- a/royal-elementor-addons/classes/modules/forms/wpr-actions-status.php
+++ b/royal-elementor-addons/classes/modules/forms/wpr-actions-status.php
@@ -29,6 +29,18 @@
return; // Get out of here, the nonce is rotten!
}
+ $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
+ $submission_secret = isset( $_POST['submission_secret'] ) ? sanitize_text_field( wp_unslash( $_POST['submission_secret'] ) ) : '';
+
+ if ( ! $post_id || get_post_type( $post_id ) !== 'wpr_submissions' ) {
+ wp_send_json_error( 'Invalid post' );
+ }
+
+ $stored_secret = get_post_meta( $post_id, '_wpr_submission_action_secret', true );
+ if ( ! is_string( $stored_secret ) || $stored_secret === '' || ! hash_equals( $stored_secret, $submission_secret ) ) {
+ wp_send_json_error( 'Invalid submission secret.' );
+ }
+
// Validate custom token
// $custom_token = $_POST['custom_token'];
@@ -52,7 +64,6 @@
// return;
// }
- $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
$action_name = isset($_POST['action_name']) ? sanitize_text_field($_POST['action_name']) : '';
$status = isset($_POST['status']) ? sanitize_text_field($_POST['status']) : '';
$message = isset($_POST['message']) ? sanitize_text_field($_POST['message']) : '';
@@ -62,10 +73,6 @@
'message' => $message
];
- if (get_post_type($post_id) !== 'wpr_submissions') {
- wp_send_json_error('Invalid post');
- }
-
$actions_whitelist = [
'wpr_form_builder_email',
'wpr_form_builder_submissions',
--- a/royal-elementor-addons/classes/modules/forms/wpr-submissions-cpt.php
+++ b/royal-elementor-addons/classes/modules/forms/wpr-submissions-cpt.php
@@ -64,11 +64,19 @@
update_post_meta($post_id, 'wpr_form_page_id', $sanitized_form_page_id);
update_post_meta($post_id, 'wpr_user_agent', sanitize_textarea_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ));
update_post_meta($post_id, 'wpr_user_ip', Utilities::get_client_ip());
+
+ // One-time secret for updating submission action meta (see WPR_Actions_Status); not guessable per post_id.
+ $submission_action_secret = '';
+ if ( $post_id ) {
+ $submission_action_secret = bin2hex( random_bytes( 32 ) );
+ update_post_meta( $post_id, '_wpr_submission_action_secret', $submission_action_secret );
+ }
if( $post_id ) {
wp_send_json_success(array(
'action' => 'wpr_form_builder_submissions',
'post_id' => $post_id,
+ 'submission_secret' => $submission_action_secret,
'message' => esc_html__('Submission created successfully', 'wpr-addons'),
'status' => 'success',
'content' => $_POST['form_content']
@@ -101,6 +109,7 @@
'_elementor_data',
'_elementor_controls_usage',
'_wp_attached_file',
+ '_wpr_submission_action_secret',
// Add more if needed
];
--- a/royal-elementor-addons/classes/modules/wpr-filter-grid-media.php
+++ b/royal-elementor-addons/classes/modules/wpr-filter-grid-media.php
@@ -103,6 +103,7 @@
$args = [
'post_type' => 'attachment',
'post_status' => 'inherit',
+ 'post_mime_type' => 'image',
'tax_query' => $this->get_tax_query_args(),
'post__not_in' => $settings[ 'query_exclude_attachment' ],
'posts_per_page' => $settings['query_posts_per_page'],
@@ -827,202 +828,6 @@
}
}
- // Render Grid Pagination
- public function render_grid_pagination( $settings ) {
- // Return if Disabled
- if ( 'yes' !== $settings['layout_pagination'] || 1 === $this->get_max_num_pages( $settings ) || 'slider' === $settings['layout_select'] ) {
- return;
- }
-
- global $paged;
- $pages = $this->get_max_num_pages( $settings );
- $paged = empty( $paged ) ? 1 : $paged;
-
- if ( !defined('WPR_ADDONS_PRO_VERSION') || !wpr_fs()->can_use_premium_code() ) {
- $settings['pagination_type'] = 'pro-is' == $settings['pagination_type'] ? 'default' : $settings['pagination_type'];
- }
-
- echo '<div class="wpr-grid-pagination elementor-clearfix wpr-grid-pagination-'. esc_attr($settings['pagination_type']) .'">';
-
- // Default
- if ( 'default' === $settings['pagination_type'] ) {
- if ( $paged < $pages ) {
- echo '<a href="'. esc_url(get_pagenum_link( $paged + 1, true )) .'" class="wpr-prev-post-link">';
- echo Utilities::get_wpr_icon( $settings['pagination_on_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo esc_html($settings['pagination_older_text']);
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-prev-post-link wpr-disabled-arrow">';
- echo Utilities::get_wpr_icon( $settings['pagination_on_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo esc_html($settings['pagination_older_text']);
- echo '</span>';
- }
-
- if ( $paged > 1 ) {
- echo '<a href="'. esc_url(get_pagenum_link( $paged - 1, true )) .'" class="wpr-next-post-link">';
- echo esc_html($settings['pagination_newer_text']);
- echo Utilities::get_wpr_icon( $settings['pagination_on_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-next-post-link wpr-disabled-arrow">';
- echo esc_html($settings['pagination_newer_text']);
- echo Utilities::get_wpr_icon( $settings['pagination_on_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</span>';
- }
-
- // Numbered
- } elseif ( 'numbered' === $settings['pagination_type'] ) {
- $range = $settings['pagination_range'];
- $showitems = ( $range * 2 ) + 1;
-
- if ( 1 !== $pages ) {
-
- if ( 'yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last'] ) {
- echo '<div class="wpr-grid-pagi-left-arrows">';
-
- if ( 'yes' === $settings['pagination_first_last'] ) {
- if ( $paged >= 2 ) {
- echo '<a href="'. esc_url(get_pagenum_link( 1, true )) .'" class="wpr-first-page">';
- echo Utilities::get_wpr_icon( $settings['pagination_fl_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '<span>'. esc_html($settings['pagination_first_text']) .'</span>';
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-first-page wpr-disabled-arrow">';
- echo Utilities::get_wpr_icon( $settings['pagination_fl_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '<span>'. esc_html($settings['pagination_first_text']) .'</span>';
- echo '</span>';
- }
- }
-
- if ( 'yes' === $settings['pagination_prev_next'] ) {
- if ( $paged > 1 ) {
- echo '<a href="'. esc_url(get_pagenum_link( $paged - 1, true )) .'" class="wpr-prev-page">';
- echo Utilities::get_wpr_icon( $settings['pagination_pn_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '<span>'. esc_html($settings['pagination_prev_text']) .'</span>';
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-prev-page wpr-disabled-arrow">';
- echo Utilities::get_wpr_icon( $settings['pagination_pn_icon'], 'left' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '<span>'. esc_html($settings['pagination_prev_text']) .'</span>';
- echo '</span>';
- }
- }
-
- echo '</div>';
- }
-
- for ( $i = 1; $i <= $pages; $i++ ) {
- if ( 1 !== $pages && ( ! ( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
- if ( $paged === $i ) {
- echo '<span class="wpr-grid-current-page">'. esc_html($i) .'</span>';
- } else {
- echo '<a href="'. esc_url(get_pagenum_link( $i, true )) .'">'. esc_html($i) .'</a>';
- }
- }
- }
-
- if ( 'yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last'] ) {
- echo '<div class="wpr-grid-pagi-right-arrows">';
-
- if ( 'yes' === $settings['pagination_prev_next'] ) {
- if ( $paged < $pages ) {
- echo '<a href="'. esc_url(get_pagenum_link( $paged + 1, true )) .'" class="wpr-next-page">';
- echo '<span>'. esc_html($settings['pagination_next_text']) .'</span>';
- echo Utilities::get_wpr_icon( $settings['pagination_pn_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-next-page wpr-disabled-arrow">';
- echo '<span>'. esc_html($settings['pagination_next_text']) .'</span>';
- echo Utilities::get_wpr_icon( $settings['pagination_pn_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</span>';
- }
- }
-
- if ( 'yes' === $settings['pagination_first_last'] ) {
- if ( $paged <= $pages - 1 ) {
- echo '<a href="'. esc_url(get_pagenum_link( $pages, true )) .'" class="wpr-last-page">';
- echo '<span>'. esc_html($settings['pagination_last_text']) .'</span>';
- echo Utilities::get_wpr_icon( $settings['pagination_fl_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</a>';
- } elseif ( 'yes' === $settings['pagination_disabled_arrows'] ) {
- echo '<span class="wpr-last-page wpr-disabled-arrow">';
- echo '<span>'. esc_html($settings['pagination_last_text']) .'</span>';
- echo Utilities::get_wpr_icon( $settings['pagination_fl_icon'], 'right' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- echo '</span>';
- }
- }
-
- echo '</div>';
- }
- }
-
- // Load More / Infinite Scroll
- } else {
- echo '<a href="'. esc_url(get_pagenum_link( $paged + 1, true )) .'" class="wpr-load-more-btn" data-e-disable-page-transition >';
- echo esc_html($settings['pagination_load_more_text']);
- echo '</a>';
-
- echo '<div class="wpr-pagination-loading">';
- switch ( $settings['pagination_animation'] ) {
- case 'loader-1':
- echo '<div class="wpr-double-bounce">';
- echo '<div class="wpr-child wpr-double-bounce1"></div>';
- echo '<div class="wpr-child wpr-double-bounce2"></div>';
- echo '</div>';
- break;
- case 'loader-2':
- echo '<div class="wpr-wave">';
- echo '<div class="wpr-rect wpr-rect1"></div>';
- echo '<div class="wpr-rect wpr-rect2"></div>';
- echo '<div class="wpr-rect wpr-rect3"></div>';
- echo '<div class="wpr-rect wpr-rect4"></div>';
- echo '<div class="wpr-rect wpr-rect5"></div>';
- echo '</div>';
- break;
- case 'loader-3':
- echo '<div class="wpr-spinner wpr-spinner-pulse"></div>';
- break;
- case 'loader-4':
- echo '<div class="wpr-chasing-dots">';
- echo '<div class="wpr-child wpr-dot1"></div>';
- echo '<div class="wpr-child wpr-dot2"></div>';
- echo '</div>';
- break;
- case 'loader-5':
- echo '<div class="wpr-three-bounce">';
- echo '<div class="wpr-child wpr-bounce1"></div>';
- echo '<div class="wpr-child wpr-bounce2"></div>';
- echo '<div class="wpr-child wpr-bounce3"></div>';
- echo '</div>';
- break;
- case 'loader-6':
- echo '<div class="wpr-fading-circle">';
- echo '<div class="wpr-circle wpr-circle1"></div>';
- echo '<div class="wpr-circle wpr-circle2"></div>';
- echo '<div class="wpr-circle wpr-circle3"></div>';
- echo '<div class="wpr-circle wpr-circle4"></div>';
- echo '<div class="wpr-circle wpr-circle5"></div>';
- echo '<div class="wpr-circle wpr-circle6"></div>';
- echo '<div class="wpr-circle wpr-circle7"></div>';
- echo '<div class="wpr-circle wpr-circle8"></div>';
- echo '<div class="wpr-circle wpr-circle9"></div>';
- echo '<div class="wpr-circle wpr-circle10"></div>';
- echo '<div class="wpr-circle wpr-circle11"></div>';
- echo '<div class="wpr-circle wpr-circle12"></div>';
- echo '</div>';
- break;
-
- default:
- break;
- }
- echo '</div>';
-
- echo '<p class="wpr-pagination-finish">'. esc_html($settings['pagination_finish_text']) .'</p>';
- }
-
- echo '</div>';
- }
-
public function wpr_get_media_filtered_count() {
$nonce = $_POST['nonce'];
--- a/royal-elementor-addons/classes/modules/wpr-grid-helpers.php
+++ b/royal-elementor-addons/classes/modules/wpr-grid-helpers.php
@@ -29,7 +29,6 @@
}
public function get_dependent_terms() {
- // check_ajax_referer('wpr_addons_elementor', 'nonce');
if ( empty($_POST['taxonomy']) || empty($_POST['parent_term']) ) {
wp_send_json_error('Missing data');
@@ -807,6 +806,78 @@
return $class;
}
+ /**
+ * URL used for grid featured image overlay and title links (and any other post-level links using this helper).
+ *
+ * @param array $settings Widget settings.
+ * @param int|null $post_id Post ID; defaults to the current post in the loop.
+ * @return string Unescaped URL string suitable for esc_url() / esc_attr() when outputting.
+ */
+ public static function get_grid_item_link_url( $settings, $post_id = null ) {
+ if ( null === $post_id ) {
+ $post_id = get_the_ID();
+ }
+
+ if ( ! is_array( $settings ) ) {
+ $settings = [];
+ }
+
+ $permalink = get_permalink( $post_id );
+
+ if ( empty( $settings['post_link_source'] ) || 'post' === $settings['post_link_source'] ) {
+ return $permalink;
+ }
+
+ if ( 'custom_field' !== $settings['post_link_source'] ) {
+ return $permalink;
+ }
+
+ $key = isset( $settings['post_link_custom_field_key'] ) ? trim( (string) $settings['post_link_custom_field_key'] ) : '';
+ if ( '' === $key ) {
+ return $permalink;
+ }
+
+ $raw_value = '';
+
+ if ( function_exists( 'get_field' ) ) {
+ $acf_val = get_field( $key, $post_id, false );
+ if ( null !== $acf_val && '' !== $acf_val && false !== $acf_val ) {
+ if ( is_array( $acf_val ) && isset( $acf_val['url'] ) ) {
+ $raw_value = $acf_val['url'];
+ } elseif ( is_string( $acf_val ) ) {
+ $raw_value = $acf_val;
+ }
+ }
+ }
+
+ if ( '' === $raw_value ) {
+ $meta = get_post_meta( $post_id, $key, true );
+ if ( is_array( $meta ) && isset( $meta['url'] ) ) {
+ $raw_value = $meta['url'];
+ } elseif ( is_string( $meta ) ) {
+ $raw_value = $meta;
+ }
+ }
+
+ $raw_value = trim( (string) $raw_value );
+
+ if ( '' === $raw_value ) {
+ return $permalink;
+ }
+
+ if ( preg_match( '#^/#', $raw_value ) && ! preg_match( '#^//#', $raw_value ) ) {
+ $raw_value = home_url( $raw_value );
+ }
+
+ $url = esc_url_raw( $raw_value );
+
+ if ( '' === $url ) {
+ return $permalink;
+ }
+
+ return $url;
+ }
+
// Render Password Protected Input
public static function render_password_protected_input( $settings ) {
if ( ! post_password_required() ) {
@@ -878,7 +949,8 @@
// Render Media Overlay
public static function render_media_overlay( $settings ) {
- echo '<div class="wpr-grid-media-hover-bg '. esc_attr(WPR_Grid_Helpers::get_animation_class( $settings, 'overlay' )) .'" data-url="'. esc_attr( get_the_permalink( get_the_ID() ) ) .'">'; // changed esc_url to esc_attr (why?)
+ $item_url = self::get_grid_item_link_url( $settings );
+ echo '<div class="wpr-grid-media-hover-bg '. esc_attr(WPR_Grid_Helpers::get_animation_class( $settings, 'overlay' )) .'" data-url="'. esc_attr( $item_url ) .'">'; // changed esc_url to esc_attr (why?)
if ( defined('WPR_ADDONS_PRO_VERSION') && wpr_fs()->can_use_premium_code() ) {
if ( '' !== $settings['overlay_image']['url'] ) {
@@ -904,7 +976,8 @@
echo '<'. esc_attr($element_title_tag) .' class="'. esc_attr($class) .'">';
echo '<div class="inner-block">';
- echo '<a target="'. $open_links_in_new_tab .'" '. $pointer_item_class .' href="'. esc_url( get_the_permalink() ) .'">';
+ $title_link_url = is_array( $general_settings ) ? self::get_grid_item_link_url( $general_settings ) : get_the_permalink();
+ echo '<a target="'. $open_links_in_new_tab .'" '. $pointer_item_class .' href="'. esc_url( $title_link_url ) .'">';
if ( 'word_count' === $settings['element_trim_text_by'] ) {
echo esc_html(wp_trim_words( get_the_title(), $settings['element_word_count'] ));
} else {
--- a/royal-elementor-addons/classes/modules/wpr-load-more-instagram-posts.php
+++ b/royal-elementor-addons/classes/modules/wpr-load-more-instagram-posts.php
@@ -23,14 +23,20 @@
add_action('wp_ajax_nopriv_wpr_load_more_instagram_posts', [$this, 'wpr_load_more_instagram_posts_function']);
}
- public function call_instagram_api($access_token, $settings) {
- $url = 'https://graph.instagram.com/me/media?fields=id,media_type,media_url,thumbnail_url,permalink,username,caption,timestamp&access_token='. $access_token .'&limit='. ($settings['limit'] + $_POST['next_post_index']);
+ public function call_instagram_api( $access_token, $settings, $next_post_index ) {
+ $limit = isset( $settings['limit'] ) ? absint( $settings['limit'] ) : 0;
+ $next_post_index = absint( $next_post_index );
+ $access_token = rawurlencode( (string) $access_token );
+ $url = 'https://graph.instagram.com/me/media?fields=id,media_type,media_url,thumbnail_url,permalink,username,caption,timestamp&access_token='. $access_token .'&limit='. ( $limit + $next_post_index );
$response = wp_remote_get($url);
+ if ( is_wp_error( $response ) || empty( $response['body'] ) ) {
+ return [];
+ }
$body = json_decode($response['body']);
- if(!isset($body)) {
- return $response['body'];
+ if ( ! isset( $body->data ) || ! is_array( $body->data ) ) {
+ return [];
}
- return $body->data;
+ return $body->data;
}
// Get Animation Class
@@ -54,14 +60,14 @@
// Render Post Title
public function render_post_username( $settings, $class, $result ) {
- $target = 'yes' == $_POST['wpr_load_more_settings']['open_in_new_tab'] ? '_blank' : '_self';
+ $target = ( isset( $settings['open_in_new_tab'] ) && 'yes' === $settings['open_in_new_tab'] ) ? '_blank' : '_self';
$tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p'];
$element_username_tag = Utilities::validate_html_tags_wl( $settings['element_username_tag'], 'h2', $tags_whitelist );
echo '<'. esc_attr($element_username_tag) .' class="'. esc_attr($class) .'">';
echo '<div class="inner-block">';
- echo '<a href="'. $result->permalink .'" target="'. $target .'">';
+ echo '<a href="'. esc_url( $result->permalink ) .'" target="'. esc_attr( $target ) .'">';
echo esc_html($result->username);
echo '</a>';
echo '</div>';
@@ -96,9 +102,9 @@
// Date
if ( 'yes' === $settings['element_hide_year'] ) {
- echo date('F j', strtotime($result->timestamp));
+ echo esc_html( date('F j', strtotime($result->timestamp)) );
} else {
- echo date(get_option( 'date_format' ), strtotime($result->timestamp));
+ echo esc_html( date(get_option( 'date_format' ), strtotime($result->timestamp)) );
}
// Icon: After
@@ -116,11 +122,11 @@
public function render_post_icon($settings, $class, $result) {
- $target = 'yes' == $_POST['wpr_load_more_settings']['open_in_new_tab'] ? '_blank' : '_self';
+ $target = ( isset( $settings['open_in_new_tab'] ) && 'yes' === $settings['open_in_new_tab'] ) ? '_blank' : '_self';
echo '<div class="'. esc_attr($class) .'">';
echo '<div class="inner-block">';
- echo '<a href='. $result->permalink .' target='. $target .'>';
+ echo '<a href="'. esc_url( $result->permalink ) .'" target="'. esc_attr( $target ) .'">';
echo '<i class="fab fa-instagram"></i>';
echo '</a>';
echo '</div>';
@@ -392,28 +398,44 @@
// Render Media Overlay
public function render_media_overlay( $settings, $result ) {
- $target = 'yes' == $_POST['wpr_load_more_settings']['open_in_new_tab'] ? '_blank' : '_self';
+ $target = ( isset( $settings['open_in_new_tab'] ) && 'yes' === $settings['open_in_new_tab'] ) ? '_blank' : '_self';
- echo '<div class="wpr-insta-feed-media-hover-bg '. esc_attr($this->get_animation_class( $settings, 'overlay' )) .'" data-url="'. $result->permalink .'" data-target="'. $target .'">';
+ echo '<div class="wpr-insta-feed-media-hover-bg '. esc_attr($this->get_animation_class( $settings, 'overlay' )) .'" data-url="'. esc_url( $result->permalink ) .'" data-target="'. esc_attr( $target ) .'">';
echo '</div>';
}
public function wpr_load_more_instagram_posts_function() {
- $settings = $_POST['wpr_load_more_settings'];
-
- if ( get_transient('wpr_instagram_access_token'. $_POST['wpr_insta_feed_widget_id']) ) {
- $instagram_token = get_transient('wpr_instagram_access_token'. $_POST['wpr_insta_feed_widget_id']);
- } else {
- $instagram_token = $settings['instagram_access_token'];
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wpr-addons-js' ) ) {
+ wp_die();
}
-
- foreach($this->call_instagram_api($instagram_token, $_POST['wpr_load_more_settings']) as $key=>$result) : ?>
+
+ if ( empty( $_POST['wpr_load_more_settings'] ) || ! is_array( $_POST['wpr_load_more_settings'] ) ) {
+ wp_die();
+ }
+
+ $settings = wp_unslash( $_POST['wpr_load_more_settings'] );
+ $widget_id = isset( $_POST['wpr_insta_feed_widget_id'] ) ? sanitize_text_field( wp_unslash( $_POST['wpr_insta_feed_widget_id'] ) ) : '';
+ $next_post_index = isset( $_POST['next_post_index'] ) ? absint( wp_unslash( $_POST['next_post_index'] ) ) : 0;
+
+ $instagram_token = '';
+ if ( $widget_id ) {
+ $instagram_token = get_transient( 'wpr_instagram_access_token'. $widget_id );
+ if ( empty( $instagram_token ) ) {
+ $instagram_token = get_option( 'wpr_instagram_access_token_to_compare'. $widget_id );
+ }
+ }
+
+ if ( empty( $instagram_token ) ) {
+ wp_die();
+ }
+
+ foreach ( $this->call_instagram_api( $instagram_token, $settings, $next_post_index ) as $key => $result ) : ?>
<?php
if ( $key >= 6 && (!defined('WPR_ADDONS_PRO_VERSION') || !wpr_fs()->can_use_premium_code()) ) {
break;
}
- if ($key < $_POST['next_post_index']) :
+ if ($key < $next_post_index) :
continue;
endif;
?>
@@ -422,37 +444,37 @@
<figure>
<?php
// Content: Below Media
- echo $this->get_elements_by_location( 'above', $_POST['wpr_load_more_settings'], $result );
+ echo $this->get_elements_by_location( 'above', $settings, $result );
?>
- <div class="wpr-insta-feed-media-wrap <?php echo esc_attr($this->get_image_effect_class( $_POST['wpr_load_more_settings'] )) ?>" data-overlay-link="<?php echo esc_attr( $_POST['wpr_load_more_settings']['overlay_post_link'] ) ?>">
+ <div class="wpr-insta-feed-media-wrap <?php echo esc_attr($this->get_image_effect_class( $settings )) ?>" data-overlay-link="<?php echo esc_attr( $settings['overlay_post_link'] ) ?>">
<?php if ( 'CAROUSEL_ALBUM' == $result->media_type || 'IMAGE' == $result->media_type ) : ?>
- <div class="wpr-insta-feed-image-wrap" data-src=<?php echo $result->media_url ?>>
- <img src=<?php echo $result->media_url ?> alt="">
+ <div class="wpr-insta-feed-image-wrap" data-src="<?php echo esc_url( $result->media_url ); ?>">
+ <img src="<?php echo esc_url( $result->media_url ); ?>" alt="">
</div>
<?php else : ?>
- <div class="wpr-insta-feed-image-wrap" data-src=<?php echo $result->thumbnail_url ?>>
- <img class="wpr-insta-feed-thumb" src=<?php echo $result->thumbnail_url ?> alt="">
+ <div class="wpr-insta-feed-image-wrap" data-src="<?php echo esc_url( $result->thumbnail_url ); ?>">
+ <img class="wpr-insta-feed-thumb" src="<?php echo esc_url( $result->thumbnail_url ); ?>" alt="">
</div>
<?php endif ; ?>
<div class="wpr-insta-feed-media-hover wpr-animation-wrap">
<?php
// Media Overlay
- $this->render_media_overlay( $_POST['wpr_load_more_settings'], $result );
+ $this->render_media_overlay( $settings, $result );
// Content: Over Media
- $this->get_elements_by_location( 'over', $_POST['wpr_load_more_settings'], $result );
+ $this->get_elements_by_location( 'over', $settings, $result );
?>
</div>
</div>
<?php
// Content: Below Media
- echo $this->get_elements_by_location( 'below', $_POST['wpr_load_more_settings'], $result );
+ echo $this->get_elements_by_location( 'below', $settings, $result );
?>
</figure>
</div>
<?php endforeach;
- die();
+ wp_die();
}
}
--- a/royal-elementor-addons/classes/utilities.php
+++ b/royal-elementor-addons/classes/utilities.php
@@ -72,8 +72,11 @@
'Twitter Feed' => ['twitter-feed', 'https://royal-elementor-addons.com/elementor-twitter-feed-widget/', '', ''],
'Image Scroll' => ['image-scroll', 'https://royal-elementor-addons.com/elementor-image-scroll-widget/', '', ''],
'Date' => ['date', 'https://royal-elementor-addons.com/elementor-date-widget/', '', ''],
- // 'Video Playlist' => ['video-playlist', 'https://royal-elementor-addons.com/elementor-video-playlist-widget/', '', ''],
+ 'Video Playlist' => ['video-playlist', '', '', 'new'],
'Password Protected Content' => ['password-protected-content', '', '', 'new'],
+ 'Icon Box' => ['icon-box', '', '', 'new'],
+ 'Separator' => ['separator', '', '', 'new'],
+ // 'Random Image' => ['random-image', '', '', 'new'],
'Circle Menu' => ['circle-menu', '', '', 'new'],
'Unfold' => ['unfold', '', '', 'new'],
];
@@ -1394,4 +1397,71 @@
return $value;
}
+ public static function get_all_breakpoints( $type = 'assoc' ) {
+ $devices = array(
+ 'desktop' => __( 'Desktop', 'elementor' ),
+ );
+
+ if (
+ class_exists( 'ElementorPlugin' ) &&
+ isset( ElementorPlugin::$instance->breakpoints ) &&
+ method_exists( ElementorPlugin::$instance->breakpoints, 'get_active_breakpoints' )
+ ) {
+ $active_breakpoints = ElementorPlugin::$instance->breakpoints->get_active_breakpoints();
+
+ if ( is_array( $active_breakpoints ) ) {
+ foreach ( $active_breakpoints as $key => $breakpoint ) {
+ if ( 'desktop' === $key ) {
+ continue;
+ }
+
+ $label = '';
+
+ if ( is_object( $breakpoint ) && method_exists( $breakpoint, 'get_label' ) ) {
+ $label = $breakpoint->get_label();
+ }
+
+ if ( '' === $label ) {
+ $label = ucwords( str_replace( '_', ' ', $key ) );
+ }
+
+ $devices[ $key ] = $label;
+ }
+ }
+ }
+
+ if ( ! isset( $devices['tablet'] ) ) {
+ $devices['tablet'] = __( 'Tablet', 'elementor' );
+ }
+
+ if ( ! isset( $devices['mobile'] ) ) {
+ $devices['mobile'] = __( 'Mobile', 'elementor' );
+ }
+
+ $order = array(
+ 'widescreen',
+ 'desktop',
+ 'laptop',
+ 'tablet_extra',
+ 'tablet',
+ 'mobile_extra',
+ 'mobile',
+ );
+
+ $ordered_devices = array();
+
+ foreach ( $order as $breakpoint_key ) {
+ if ( isset( $devices[ $breakpoint_key ] ) ) {
+ $ordered_devices[ $breakpoint_key ] = $devices[ $breakpoint_key ];
+ }
+ }
+
+ foreach ( $devices as $breakpoint_key => $label ) {
+ if ( ! isset( $ordered_devices[ $breakpoint_key ] ) ) {
+ $ordered_devices[ $breakpoint_key ] = $label;
+ }
+ }
+
+ return ( 'keys' === $type ) ? array_keys( $ordered_devices ) : $ordered_devices;
+ }
}
No newline at end of file
--- a/royal-elementor-addons/extensions/wpr-column-slider.php
+++ b/royal-elementor-addons/extensions/wpr-column-slider.php
@@ -0,0 +1,833 @@
+<?php
+use ElementorControls_Manager;
+use WprAddonsClassesUtilities;
+use ElementorGroup_Control_Typography;
+
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+class Wpr_Column_Slider {
+ public function __construct() {
+ add_action( 'elementor/element/section/section_advanced/after_section_end', [ $this, 'register_controls' ], 10 );
+ add_action( 'elementor/section/print_template', array( $this, '_print_template' ), 10, 2 );
+ add_action( 'elementor/frontend/section/before_render', array( $this, '_before_render' ), 10, 1 );
+
+ // FLEXBOX CONTAINER
+ add_action( 'elementor/element/container/section_layout/after_section_end', [ $this, 'register_controls' ], 10 );
+ add_action( 'elementor/container/print_template', array( $this, '_print_template' ), 10, 2 );
+ add_action( 'elementor/frontend/container/before_render', array( $this, '_before_render' ), 10, 1 );
+
+ }
+
+ public function register_controls( $element ) {
+
+ $element->start_controls_section(
+ 'wpr_section_column_slider',
+ [
+ 'tab' => Controls_Manager::TAB_ADVANCED,
+ 'label' => sprintf(esc_html__('Column Slider - %s', 'wpr-addons'), esc_html('RA')),
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_section_column_slider_update',
+ [
+ 'type' => Controls_Manager::RAW_HTML,
+ 'raw' => '<div class="elementor-update-preview editor-wpr-preview-update"><span>Update changes to Preview</span><button class="elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply</button>',
+ 'separator' => 'after'
+ ]
+ );
+
+ $element->add_control (
+ 'wpr_enable_column_slider',
+ [
+ 'type' => Controls_Manager::SWITCHER,
+ 'label' => esc_html__( 'Enable Column Slider', 'wpr-addons' ),
+ 'description' => esc_html__( 'Converts section columns into a horizontal sliding carousel. Each column becomes a slide that users can swipe or navigate through. Click "Apply" above after enabling to see the changes.', 'wpr-addons' ),
+ 'default' => 'no',
+ 'return_value' => 'yes',
+ 'prefix_class' => 'wpr-column-slider-',
+ 'render_type' => 'template',
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_column_slider_slides_to_show',
+ [
+ 'label' => esc_html__( 'Slides To Show', 'wpr-addons' ),
+ 'description' => esc_html__( 'Number of slides visible at once. Set different values per breakpoint for responsive behavior.', 'wpr-addons' ),
+ 'type' => Controls_Manager::NUMBER,
+ 'default' => 1,
+ 'min' => 1,
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_column_slider_space_between',
+ [
+ 'label' => __( 'Gutter', 'wpr-addons' ),
+ 'type' => ElementorControls_Manager::NUMBER,
+ 'default' => 5,
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_column_slider_speed',
+ [
+ 'label' => __( 'Speed', 'wpr-addons' ),
+ 'type' => ElementorControls_Manager::NUMBER,
+ 'default' => 3500,
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control (
+ 'wpr_enable_cs_nav',
+ [
+ 'type' => Controls_Manager::SWITCHER,
+ 'label' => esc_html__( 'Navigation', 'wpr-addons' ),
+ 'render_type' => 'template',
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_arrows',
+ [
+ 'label' => esc_html__( 'Navigation Icon', 'wpr-addons' ),
+ 'type' => Controls_Manager::SELECT,
+ 'default' => 'fas fa-angle',
+ 'options' => [
+ 'fas fa-angle' => esc_html__( 'Angle', 'wpr-addons' ),
+ 'fas fa-angle-double' => esc_html__( 'Angle Double', 'wpr-addons' ),
+ 'fas fa-arrow' => esc_html__( 'Arrow', 'wpr-addons' ),
+ 'fas fa-arrow-alt-circle' => esc_html__( 'Arrow Circle', 'wpr-addons' ),
+ 'far fa-arrow-alt-circle' => esc_html__( 'Arrow Circle Alt', 'wpr-addons' ),
+ 'fas fa-long-arrow-alt' => esc_html__( 'Long Arrow', 'wpr-addons' ),
+ 'fas fa-chevron' => esc_html__( 'Chevron', 'wpr-addons' ),
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->start_controls_tabs(
+ 'wpr_cs_nav_tabs',
+ [
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->start_controls_tab(
+ 'wpr_cs_nav_tab_normal',
+ [
+ 'label' => __( 'Normal', 'wpr-addons' ),
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_color',
+ [
+ 'label' => esc_html__( 'Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '#FFF',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev i' => 'color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next i' => 'color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev svg' => 'fill: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next svg' => 'fill: {{VALUE}}'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_bg_color',
+ [
+ 'label' => esc_html__( 'Background Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '#605BE5',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'background-color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'background-color: {{VALUE}}',
+ ],
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_border_color',
+ [
+ 'label' => esc_html__( 'Border Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'border-color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'border-color: {{VALUE}}',
+ ]
+ ]
+ );
+
+ $element->add_group_control(
+ ElementorGroup_Control_Box_Shadow::get_type(),
+ [
+ 'name' => 'box_shadow_navigation',
+ 'label' => __( 'Box Shadow', 'wpr-addons' ),
+ 'selector' => '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev, {{WRAPPER}}.wpr-column-slider-yes .swiper-button-next',
+ ]
+ );
+
+ $element->add_control(
+ 'navigation_transition',
+ [
+ 'label' => esc_html__( 'Transition', 'wpr-addons' ),
+ 'type' => Controls_Manager::NUMBER,
+ 'default' => 1,
+ 'min' => 0,
+ 'max' => 5,
+ 'step' => 0.1,
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => '-webkit-transition: all {{VALUE}}s ease; transition: all {{VALUE}}s ease;',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => '-webkit-transition: all {{VALUE}}s ease; transition: all {{VALUE}}s ease;',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev i' => '-webkit-transition-duration: {{VALUE}}s; transition-duration: {{VALUE}}s;',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next i' => '-webkit-transition-duration: {{VALUE}}s; transition-duration: {{VALUE}}s;',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev svg' => '-webkit-transition-duration: {{VALUE}}s; transition-duration: {{VALUE}}s;',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next svg' => '-webkit-transition-duration: {{VALUE}}s; transition-duration: {{VALUE}}s;'
+ ],
+ ]
+ );
+
+ $element->end_controls_tab();
+
+ $element->start_controls_tab(
+ 'wpr_cs_nav_tab_hover',
+ [
+ 'label' => __( 'Hover', 'wpr-addons' ),
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_color_hover',
+ [
+ 'label' => esc_html__( 'Icon Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next:hover i' => 'color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev:hover i' => 'color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev:hover svg' => 'fill: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next:hover svg' => 'fill: {{VALUE}}'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_bg_color_hover',
+ [
+ 'label' => esc_html__( 'Background Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '#423EC0',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev:hover' => 'background-color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next:hover' => 'background-color: {{VALUE}}',
+ ],
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_icon_border_color_hover',
+ [
+ 'label' => esc_html__( 'Border Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev:hover' => 'border-color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next:hover' => 'border-color: {{VALUE}}',
+ ]
+ ]
+ );
+
+ $element->add_group_control(
+ ElementorGroup_Control_Box_Shadow::get_type(),
+ [
+ 'name' => 'box_shadow_navigation_hover',
+ 'label' => __( 'Box Shadow', 'wpr-addons' ),
+ 'selector' => '{{WRAPPER}} .flipster__button:hover',
+ ]
+ );
+
+ $element->end_controls_tab();
+
+ $element->end_controls_tabs();
+
+ $element->add_responsive_control(
+ 'wpr_cs_nav_icon_size',
+ [
+ 'type' => Controls_Manager::SLIDER,
+ 'label' => esc_html__( 'Icon Size', 'wpr-addons' ),
+ 'size_units' => [ 'px' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 0,
+ 'max' => 200,
+ ]
+ ],
+ 'default' => [
+ 'unit' => 'px',
+ 'size' => 20,
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev i' => 'font-size: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next i' => 'font-size: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
+ ],
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_cs_nav_icon_bg_size',
+ [
+ 'type' => Controls_Manager::SLIDER,
+ 'label' => esc_html__( 'Box Size', 'wpr-addons' ),
+ 'size_units' => [ 'px' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 0,
+ 'max' => 150,
+ ]
+ ],
+ 'default' => [
+ 'unit' => 'px',
+ 'size' => 35,
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_border',
+ [
+ 'label' => esc_html__( 'Border Type', 'wpr-addons' ),
+ 'type' => Controls_Manager::SELECT,
+ 'options' => [
+ 'none' => esc_html__( 'None', 'wpr-addons' ),
+ 'solid' => esc_html__( 'Solid', 'wpr-addons' ),
+ 'double' => esc_html__( 'Double', 'wpr-addons' ),
+ 'dotted' => esc_html__( 'Dotted', 'wpr-addons' ),
+ 'dashed' => esc_html__( 'Dashed', 'wpr-addons' ),
+ 'groove' => esc_html__( 'Groove', 'wpr-addons' ),
+ ],
+ 'default' => 'none',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'border-style: {{VALUE}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'border-style: {{VALUE}};'
+ ],
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_nav_border_width',
+ [
+ 'type' => Controls_Manager::DIMENSIONS,
+ 'label' => esc_html__( 'Border Width', 'wpr-addons' ),
+ 'size_units' => [ 'px', '%' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 0,
+ 'max' => 150,
+ ],
+ '%' => [
+ 'min' => 0,
+ 'max' => 100,
+ ]
+ ],
+ 'default' => [
+ 'top' => 1,
+ 'right' => 1,
+ 'bottom' => 1,
+ 'left' => 1,
+ 'unit' => 'px'
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes',
+ 'wpr_cs_nav_border!' => 'none'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'icon_border_radius',
+ [
+ 'type' => Controls_Manager::DIMENSIONS,
+ 'label' => esc_html__( 'Border Radius', 'wpr-addons' ),
+ 'size_units' => [ 'px', '%' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 0,
+ 'max' => 150,
+ ],
+ '%' => [
+ 'min' => 0,
+ 'max' => 100,
+ ]
+ ],
+ 'default' => [
+ 'top' => 0,
+ 'right' => 0,
+ 'bottom' => 0,
+ 'left' => 0,
+ 'unit' => 'px'
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-prev' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-button-next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_nav' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_control (
+ 'wpr_enable_cs_pag',
+ [
+ 'type' => Controls_Manager::SWITCHER,
+ 'label' => esc_html__( 'Pagination', 'wpr-addons' ),
+ 'render_type' => 'template',
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_pag_type',
+ [
+ 'label' => esc_html__( 'Pagination Type', 'wpr-addons' ),
+ 'type' => Controls_Manager::SELECT,
+ 'default' => 'bullets',
+ 'options' => [
+ 'bullets' => esc_html__( 'Bullets', 'wpr-addons' ),
+ 'fraction' => esc_html__( 'Fraction', 'wpr-addons' ),
+ 'progressbar' => esc_html__( 'Progressbar', 'wpr-addons' ),
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_pag_color',
+ [
+ 'label' => esc_html__( 'Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '#605BE5',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-bullet' => 'background-color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-fraction' => 'color: {{VALUE}}',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-progressbar' => 'background-color: {{VALUE}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-progressbar-fill' => 'background-color: {{VALUE}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_pag_active_color',
+ [
+ 'label' => esc_html__( 'Active Bullet Color', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-bullet-active' => 'background-color: {{VALUE}}',
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'bullets'
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_cs_pag_bg_color',
+ [
+ 'label' => esc_html__( 'Bar Background', 'wpr-addons' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '#EDEDED',
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-progressbar' => 'background-color: {{VALUE}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'progressbar'
+ ]
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_cs_pag_progressbar_height',
+ [
+ 'type' => Controls_Manager::SLIDER,
+ 'label' => esc_html__( 'Progress Bar Height', 'wpr-addons' ),
+ 'size_units' => [ 'px' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 1,
+ 'max' => 15,
+ ]
+ ],
+ 'default' => [
+ 'unit' => 'px',
+ 'size' => 5,
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-progressbar' => 'height: {{SIZE}}{{UNIT}};',
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-progressbar-fill' => 'height: {{SIZE}}{{UNIT}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'progressbar'
+ ]
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_cs_pag_size',
+ [
+ 'type' => Controls_Manager::SLIDER,
+ 'label' => esc_html__( 'Box Size', 'wpr-addons' ),
+ 'size_units' => [ 'px' ],
+ 'range' => [
+ 'px' => [
+ 'min' => 0,
+ 'max' => 50,
+ ]
+ ],
+ 'default' => [
+ 'unit' => 'px',
+ 'size' => 7,
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'bullets'
+ ]
+ ]
+ );
+
+ $element->add_group_control(
+ ElementorGroup_Control_Typography::get_type(),
+ [
+ 'name' => 'wpr_cs_pag_fraction_typography',
+ 'label' => __( 'Typography', 'wpr-addons' ),
+ 'selector' => '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-fraction',
+ 'fields_options' => [
+ 'typography' => [
+ 'default' => 'custom',
+ ],
+ 'font_size' => [
+ 'default' => [
+ 'size' => '14',
+ 'unit' => 'px',
+ ]
+ ]
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'fraction'
+ ]
+ ]
+ );
+
+ $element->add_responsive_control(
+ 'wpr_cs_pag_margin',
+ [
+ 'label' => esc_html__( 'Margin', 'wpr-addons' ),
+ 'type' => Controls_Manager::DIMENSIONS,
+ 'size_units' => [ 'px', '%' ],
+ 'default' => [
+ 'top' => 0,
+ 'right' => 6,
+ 'bottom' => 0,
+ 'left' => 6,
+ ],
+ 'selectors' => [
+ '{{WRAPPER}}.wpr-column-slider-yes .swiper-pagination-bullet' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
+ ],
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_cs_pag' => 'yes',
+ 'wpr_cs_pag_type' => 'bullets'
+ ]
+ ]
+ );
+
+ $element->add_control (
+ 'wpr_enable_column_slider_autoplay',
+ [
+ 'type' => Controls_Manager::SWITCHER,
+ 'label' => esc_html__( 'Autoplay', 'wpr-addons' ),
+ 'render_type' => 'template',
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->add_control(
+ 'wpr_column_slider_delay',
+ [
+ 'label' => __( 'Delay', 'wpr-addons' ),
+ 'type' => ElementorControls_Manager::NUMBER,
+ 'default' => 1000,
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ 'wpr_enable_column_slider_autoplay' => 'yes'
+ ]
+ ]
+ );
+
+ $element->add_control (
+ 'wpr_enable_column_slider_loop',
+ [
+ 'type' => Controls_Manager::SWITCHER,
+ 'label' => esc_html__( 'Loop', 'wpr-addons' ),
+ 'render_type' => 'template',
+ 'separator' => 'before',
+ 'condition' => [
+ 'wpr_enable_column_slider' => 'yes',
+ ]
+ ]
+ );
+
+ $element->end_controls_section();
+
+ }
+
+ public function _before_render( $element ) {
+ if ( $element->get_name() !== 'section' && $element->get_name() !== 'container' ) {
+ return;
+ }
+
+ $settings = $element->get_settings_for_display();
+
+ if ( 'yes' === $settings['wpr_enable_column_slider'] ) {
+ if ( wp_style_is( 'e-swiper', 'registered' ) ) {
+ wp_enqueue_style( 'e-swiper' );
+ } elseif ( wp_style_is( 'swiper', 'registered' ) ) {
+ wp_enqueue_style( 'swiper' );
+ }
+
+ $navigation = $settings['wpr_enable_cs_nav'];
+ $pagination = $settings['wpr_enable_cs_pag'];
+ $pagination_type = isset($settings['wpr_cs_pag_type']) ? $settings['wpr_cs_pag_type'] : '';
+ $autoplay = $settings['wpr_enable_column_slider_autoplay'];
+ $loop = $settings['wpr_enable_column_slider_loop'];
+ $slides_to_show = $settings['wpr_column_slider_slides_to_show'];
+ $slides_to_show_widescreen = isset($settings['wpr_column_slider_slides_to_show_widescreen']) ? $settings['wpr_column_slider_slides_to_show_widescreen'] : $slides_to_show;
+ $slides_to_show_laptop = isset($settings['wpr_column_slider_slides_to_show_laptop']) ? $settings['wpr_column_slider_slides_to_show_laptop'] : $settings['wpr_column_slider_slides_to_show'];
+ $slides_to_show_tablet_extra = isset($settings['wpr_column_slider_slides_to_show_tablet_extra']) ? $settings['wpr_column_slider_slides_to_show_tablet_extra'] : $slides_to_show_laptop;
+ $slides_to_show_tablet = isset($settings['wpr_column_slider_slides_to_show_tablet']) ? $settings['wpr_column_slider_slides_to_show_tablet'] : $slides_to_show_tablet_extra;
+ $slides_to_show_mobile_extra = isset($settings['wpr_column_slider_slides_to_show_mobile_extra']) ? $settings['wpr_column_slider_slides_to_show_mobile_extra'] : $slides_to_show_tablet;
+ $slides_to_show_mobile = isset($settings['wpr_column_slider_slides_to_show_mobile']) ? $settings['wpr_column_slider_slides_to_show_mobile'] : $slides_to_show_mobile_extra;
+ $space_between = $settings['wpr_column_slider_space_between'];
+ $space_between_widescreen = isset($settings['wpr_column_slider_space_between_widescreen']) ? $settings['wpr_column_slider_space_between_widescreen'] : $space_between;
+ $space_between_laptop = isset($settings['wpr_column_slider_space_between_laptop']) ? $settings['wpr_column_slider_space_between_laptop'] : $space_between;
+ $space_between_tablet_extra = isset($settings['wpr_column_slider_space_between_tablet_extra']) ? $settings['wpr_colum